File tree Expand file tree Collapse file tree 1 file changed +3
-7
lines changed Expand file tree Collapse file tree 1 file changed +3
-7
lines changed Original file line number Diff line number Diff line change @@ -354,18 +354,14 @@ protected function loadToken()
354354 {
355355 if ($ this ->iam_token )
356356 {
357- if ($ this ->refresh_at < microtime ( true )){
357+ if ($ this ->refresh_at < time ( )){
358358 try {
359359 return $ this ->newToken ();
360360 } catch (\Exception $ e ){
361361 return $ this ->iam_token ;
362362 }
363363 }
364- else if ($ this ->expires_at > time ())
365- {
366- return $ this ->iam_token ;
367- }
368- return $ this ->newToken ();
364+ return $ this ->iam_token ;
369365 }
370366
371367 return $ this ->loadTokenFromFile ();
@@ -386,7 +382,7 @@ protected function loadTokenFromFile()
386382 {
387383 $ this ->iam_token = $ token ->iamToken ;
388384 $ this ->expires_at = $ token ->expiresAt ;
389- $ this ->refresh_at = $ token ->refreshAt ?? $ token -> expiresAt ;
385+ $ this ->refresh_at = $ token ->refreshAt ?? time () ;
390386 $ this ->logger ()->info ('YDB: Reused IAM token [... ' . substr ($ this ->iam_token , -6 ) . ']. ' );
391387 return $ token ->iamToken ;
392388 }
You can’t perform that action at this time.
0 commit comments