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:
committed by
GitHub
parent
778afaf36b
commit
c12654bf46
@ -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()
|
||||
|
Reference in New Issue
Block a user