Fix bug in service key rotation and fix associated flaky test
We were using `datetime.now` in both the rotation code and the test, but the model uses `utcnow`.
This commit is contained in:
parent
ae9bd8b727
commit
74e8bc296e
2 changed files with 3 additions and 2 deletions
|
@ -20,7 +20,7 @@ class ServiceKeyWorker(Worker):
|
|||
"""
|
||||
expiration = timedelta(minutes=instance_keys.service_key_expiration)
|
||||
logger.debug('Starting refresh of automatic service keys')
|
||||
model.set_key_expiration(instance_keys.local_key_id, datetime.now() + expiration)
|
||||
model.set_key_expiration(instance_keys.local_key_id, datetime.utcnow() + expiration)
|
||||
logger.debug('Finished refresh of automatic service keys')
|
||||
|
||||
|
||||
|
|
Reference in a new issue