diff --git a/blog/bp/blog/routes.py b/blog/bp/blog/routes.py index 570363e..8cbc865 100644 --- a/blog/bp/blog/routes.py +++ b/blog/bp/blog/routes.py @@ -55,7 +55,8 @@ def register(url_prefix, title): async with get_session() as s: got_lock = await s.scalar(text("SELECT pg_try_advisory_lock(900001)")) if not got_lock: - return # another worker is syncing + await s.rollback() # clean up before returning connection to pool + return try: await sync_all_content_from_ghost(s) await s.commit()