This commit is contained in:
Joseph Schorr 2017-07-12 16:37:51 +03:00
parent 932db23a5c
commit 4ed73d247b
4 changed files with 9 additions and 4 deletions

View file

@ -7,11 +7,12 @@ from workers.worker import Worker
logger = logging.getLogger(__name__)
class ServiceKeyWorker(Worker):
def __init__(self):
super(ServiceKeyWorker, self).__init__()
self.add_operation(self._refresh_service_key,
app.config.get('INSTANCE_SERVICE_KEY_REFRESH', 60)*60)
app.config.get('INSTANCE_SERVICE_KEY_REFRESH', 60) * 60)
def _refresh_service_key(self):
"""
@ -22,6 +23,7 @@ class ServiceKeyWorker(Worker):
model.set_key_expiration(instance_keys.local_key_id, datetime.now() + expiration)
logger.debug('Finished refresh of automatic service keys')
if __name__ == "__main__":
worker = ServiceKeyWorker()
worker.start()