1
0
mirror of https://github.com/quay/quay.git synced 2025-07-30 07:43:13 +03:00

lock: allows global lock to be used from main app (PROJQUAY-788) (#745)

GlobalLock had a dependency on app, which would cause a circular
dependency if imported from the main app. Workaround this by requiring
to pass the configuration to the GlobalLock instead (this is done by a
classmethod, due to the use of Redlock's factory). This means before
the use of GlobalLock, "configure" will need to be called once, per process.
This commit is contained in:
Kenny Lee Sin Cheong
2021-04-14 14:44:33 -04:00
committed by GitHub
parent 778afaf36b
commit c12654bf46
7 changed files with 25 additions and 14 deletions

View File

@ -86,5 +86,6 @@ def create_gunicorn_worker():
if __name__ == "__main__":
logging.config.fileConfig(logfile_path(debug=False), disable_existing_loggers=False)
GlobalLock.configure(app.config)
worker = BlobUploadCleanupWorker()
worker.start()