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:
Joseph Schorr 2017-07-28 14:20:11 -04:00
parent ae9bd8b727
commit 74e8bc296e
2 changed files with 3 additions and 2 deletions

View file

@ -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')