~fnux/meta.sr.ht

6f52aad53eb9ae576a2b217261864040aad65383 — Galen Abell 8 months ago 013b769
Add redis connection URL for webhooks

The webhooks worker always uses the default redis URL, which breaks if
the infrastructure runs a non-default redis setup.
2 files changed, 4 insertions(+), 1 deletions(-)

M config.example.ini
M metasrht/webhooks.py
M config.example.ini => config.example.ini +3 -0
@@ 89,6 89,9 @@ connection-string=postgresql://postgres@localhost/meta.sr.ht
# Set to "yes" to automatically run migrations on package upgrade.
migrate-on-upgrade=yes
#
# The redis connection used for the webhooks worker
webhooks=redis://localhost:6379/1
#
# If "yes", the user will be sent the stock sourcehut welcome emails after
# signup (requires cron to be configured properly). These are specific to the
# sr.ht instance so you probably want to patch these before enabling this.

M metasrht/webhooks.py => metasrht/webhooks.py +1 -1
@@ 8,7 8,7 @@ if not hasattr(db, "session"):
from srht.webhook import Event
from srht.webhook.celery import CeleryWebhook, make_worker

worker = make_worker()
worker = make_worker(broker=cfg("meta.sr.ht", "webhooks", "redis://"))

class UserWebhook(CeleryWebhook):
    events = [