Use a separate queue for broadcasts
I think this will go a long way to solve the federation delay problems we're seeing on b.s. I'm not sure at what point adding more queues will create more problems than it solves, but I do think in this case the queues are out of balance and moving broadcasts (which are the most common type of `medium_priority` task at the moment) to their own queue will be an improvement.
This commit is contained in:
parent
db207065ce
commit
b167364c5c
6 changed files with 25 additions and 16 deletions
|
@ -8,7 +8,7 @@ from django.views.decorators.http import require_GET
|
|||
import redis
|
||||
|
||||
from celerywyrm import settings
|
||||
from bookwyrm.tasks import app as celery
|
||||
from bookwyrm.tasks import app as celery, LOW, MEDIUM, HIGH, IMPORTS, BROADCAST
|
||||
|
||||
r = redis.from_url(settings.REDIS_BROKER_URL)
|
||||
|
||||
|
@ -35,10 +35,11 @@ class CeleryStatus(View):
|
|||
|
||||
try:
|
||||
queues = {
|
||||
"low_priority": r.llen("low_priority"),
|
||||
"medium_priority": r.llen("medium_priority"),
|
||||
"high_priority": r.llen("high_priority"),
|
||||
"imports": r.llen("imports"),
|
||||
LOW: r.llen(LOW),
|
||||
MEDIUM: r.llen(MEDIUM),
|
||||
HIGH: r.llen(HIGH),
|
||||
IMPORTS: r.llen(IMPORTS),
|
||||
BROADCAST: r.llen(BROADCAST),
|
||||
}
|
||||
# pylint: disable=broad-except
|
||||
except Exception as err:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue