Skip to content

πŸ™Œ OpenHands: AI-Driven Development

fix(backend): install_gitlab_webhooks.py is not functioning as expected (#12185)

Hiep Le2cf64947739c
diff --git a/enterprise/sync/install_gitlab_webhooks.py b/enterprise/sync/install_gitlab_webhooks.py
index 5988879389..8f274bf81c 100644
--- a/enterprise/sync/install_gitlab_webhooks.py
+++ b/enterprise/sync/install_gitlab_webhooks.py
@@ -5,7 +5,7 @@ from uuid import uuid4
from integrations.types import GitLabResourceType
from integrations.utils import GITLAB_WEBHOOK_URL
from sqlalchemy import text
-from storage.database import session_maker
+from storage.database import a_session_maker
from storage.gitlab_webhook import GitlabWebhook, WebhookStatus
from storage.gitlab_webhook_store import GitlabWebhookStore
@@ -262,7 +262,7 @@ class VerifyWebhookStatus:
# Check if the table exists before proceeding
# This handles cases where the CronJob runs before database migrations complete
- with session_maker() as session:
+ async with a_session_maker() as session:
query = text("""
SELECT EXISTS (
SELECT FROM information_schema.tables