Merge branch 'main' into book-series-v1
This commit is contained in:
commit
5cc158e3be
11 changed files with 74 additions and 28 deletions
|
@ -8,12 +8,7 @@ import redis
|
|||
from celerywyrm import settings
|
||||
from bookwyrm.tasks import app as celery
|
||||
|
||||
r = redis.Redis(
|
||||
host=settings.REDIS_BROKER_HOST,
|
||||
port=settings.REDIS_BROKER_PORT,
|
||||
password=settings.REDIS_BROKER_PASSWORD,
|
||||
db=settings.REDIS_BROKER_DB_INDEX,
|
||||
)
|
||||
r = redis.from_url(settings.REDIS_BROKER_URL)
|
||||
|
||||
# pylint: disable= no-self-use
|
||||
@method_decorator(login_required, name="dispatch")
|
||||
|
|
|
@ -14,7 +14,7 @@ from django.views import View
|
|||
from django.views.decorators.csrf import csrf_exempt
|
||||
|
||||
from bookwyrm import activitypub, models
|
||||
from bookwyrm.tasks import app, MEDIUM
|
||||
from bookwyrm.tasks import app, MEDIUM, HIGH
|
||||
from bookwyrm.signatures import Signature
|
||||
from bookwyrm.utils import regex
|
||||
|
||||
|
@ -60,7 +60,11 @@ class Inbox(View):
|
|||
return HttpResponse()
|
||||
return HttpResponse(status=401)
|
||||
|
||||
activity_task.delay(activity_json)
|
||||
# Make activities relating to follow/unfollow a high priority
|
||||
high = ["Follow", "Accept", "Reject", "Block", "Unblock", "Undo"]
|
||||
|
||||
priority = HIGH if activity_json["type"] in high else MEDIUM
|
||||
activity_task.apply_async(args=(activity_json,), queue=priority)
|
||||
return HttpResponse()
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue