Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 13 additions & 2 deletions osism/tasks/reconciler.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

from celery import Celery
from loguru import logger
from pottery import ReleaseUnlockedLock

from osism import settings, utils
from osism.tasks import Config
Expand Down Expand Up @@ -57,7 +58,12 @@ def run(self, publish=True):
if publish:
utils.finish_task_output(self.request.id, rc=rc)

lock.release()
try:
lock.release()
except ReleaseUnlockedLock:
logger.warning(
"Lock auto-released before explicit release (auto_release_time exceeded)"
)


@app.task(bind=True, name="osism.tasks.reconciler.run_on_change")
Expand All @@ -74,4 +80,9 @@ def run_on_change(self):
)
p.wait()

lock.release()
try:
lock.release()
except ReleaseUnlockedLock:
logger.warning(
"Lock auto-released before explicit release (auto_release_time exceeded)"
)