From 7d2b6b8f6ae28eef9432d75e3f0c0230160050ec Mon Sep 17 00:00:00 2001 From: rimu <3310831+rimu@users.noreply.github.com> Date: Thu, 4 Jan 2024 16:49:11 +1300 Subject: [PATCH] membership cache flushing --- app/activitypub/routes.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/activitypub/routes.py b/app/activitypub/routes.py index 3b6523ae..fab4bb1a 100644 --- a/app/activitypub/routes.py +++ b/app/activitypub/routes.py @@ -564,7 +564,7 @@ def process_inbox_request(request_json, activitypublog_id, ip_address): community.subscriptions_count += 1 db.session.commit() activity_log.result = 'success' - cache.delete_memoized(community_membership, user, community) + cache.delete_memoized('community_membership', user, community) elif request_json['type'] == 'Undo': if request_json['object']['type'] == 'Follow': # Unsubscribe from a community @@ -582,6 +582,7 @@ def process_inbox_request(request_json, activitypublog_id, ip_address): if join_request: db.session.delete(join_request) db.session.commit() + cache.delete_memoized('community_membership', user, community) activity_log.result = 'success' elif request_json['object']['type'] == 'Like': # Undoing an upvote or downvote activity_log.activity_type = request_json['object']['type']