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()
354
354
{
355
355
if ($ this ->iam_token )
356
356
{
357
- if ($ this ->refresh_at < microtime ( true )){
357
+ if ($ this ->refresh_at < time ( )){
358
358
try {
359
359
return $ this ->newToken ();
360
360
} catch (\Exception $ e ){
361
361
return $ this ->iam_token ;
362
362
}
363
363
}
364
- else if ($ this ->expires_at > time ())
365
- {
366
- return $ this ->iam_token ;
367
- }
368
- return $ this ->newToken ();
364
+ return $ this ->iam_token ;
369
365
}
370
366
371
367
return $ this ->loadTokenFromFile ();
@@ -386,7 +382,7 @@ protected function loadTokenFromFile()
386
382
{
387
383
$ this ->iam_token = $ token ->iamToken ;
388
384
$ this ->expires_at = $ token ->expiresAt ;
389
- $ this ->refresh_at = $ token ->refreshAt ?? $ token -> expiresAt ;
385
+ $ this ->refresh_at = $ token ->refreshAt ?? time () ;
390
386
$ this ->logger ()->info ('YDB: Reused IAM token [... ' . substr ($ this ->iam_token , -6 ) . ']. ' );
391
387
return $ token ->iamToken ;
392
388
}
You can’t perform that action at this time.
0 commit comments