private static long getNextRefresh ( long tokenValiditySec ) { long interval = Config . JWT_REFRESH_INTERVAL_SEC ; // estimate when the next token refresh should be // usually every hour, or halfway until the time it expires if ( tokenValiditySec < ( 2 * interval ) ) { interval = ( tokenValiditySec / 2 ) ; } return System . currentTimeMillis ( ) + ( interval * 1000 ) ; }
Decides when the next token refresh should be .