mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-08-15 15:32:23 +02:00
Use DatetimeImmutable instead of DateTime wherever possible
This commit is contained in:
parent
eebc373734
commit
235d572f8c
39 changed files with 222 additions and 112 deletions
|
@ -75,7 +75,7 @@ class ApiTokenAuthenticator implements AuthenticatorInterface
|
|||
|
||||
$old_time = $token->getLastTimeUsed();
|
||||
//Set the last used date of the token
|
||||
$token->setLastTimeUsed(new \DateTime());
|
||||
$token->setLastTimeUsed(new \DateTimeImmutable());
|
||||
//Only flush the token if the last used date change is more than 10 minutes
|
||||
//For performance reasons we don't want to flush the token every time it is used, but only if it is used more than 10 minutes after the last time it was used
|
||||
//If a flush is later in the code we don't want to flush the token again
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue