summaryrefslogtreecommitdiffstats
path: root/gitsrht/webhooks.py
diff options
context:
space:
mode:
Diffstat (limited to 'gitsrht/webhooks.py')
-rw-r--r--gitsrht/webhooks.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/gitsrht/webhooks.py b/gitsrht/webhooks.py
new file mode 100644
index 0000000..e0fd0df
--- /dev/null
+++ b/gitsrht/webhooks.py
@@ -0,0 +1,11 @@
+from srht.config import cfg
+from srht.database import DbSession, db
+if not hasattr(db, "session"):
+ # Initialize the database if not already configured (for running daemon)
+ db = DbSession(cfg("git.sr.ht", "connection-string"))
+ import gitsrht.types
+ db.init()
+from srht.webhook.celery import make_worker
+from scmsrht.webhooks import RepoWebhook
+
+worker = make_worker(broker=cfg("git.sr.ht", "webhooks"))