delete frontpage cache when moving posts

master
Aevann1 2022-11-14 07:34:48 +02:00
parent dc23016f17
commit e83be235ba
2 changed files with 6 additions and 1 deletions

View File

@ -105,6 +105,8 @@ def sub_inactive_purge_task():
for x in dead_holes:
g.db.delete(x)
cache.delete_memoized(frontlist)
return True

View File

@ -3,7 +3,7 @@ from files.helpers.get import *
from files.helpers.alerts import *
from files.helpers.actions import *
from flask import g
from files.__main__ import app, limiter
from files.__main__ import app, limiter, cache
from os import path
from files.helpers.sanitize import filter_emojis_only
@ -180,4 +180,7 @@ def move_post(post:Submission, v:User, reason:str) -> Union[bool, str]:
else: position = f'/h/{sub_from} Mod'
message = f"@{v.username} ({position}) has moved [{post.title}]({post.shortlink}) to /h/{post.sub}"
send_repeatable_notification(post.author_id, message)
cache.delete_memoized(frontlist)
return f"Post moved to /h/{post.sub}"