Skip to content

Commit

Permalink
Clear chapter html cache after minor edits
Browse files Browse the repository at this point in the history
  • Loading branch information
andreymal committed Jun 8, 2024
1 parent 0ce532f commit 5d2ff89
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions mini_fiction/bl/stories.py
Original file line number Diff line number Diff line change
Expand Up @@ -1800,6 +1800,12 @@ def update(self, editor, data, minor=False):
flags=flags,
)

# TODO: перенести всё кэширование из models куда-то сюда
if 'notes' in edited_data:
current_app.cache.delete(f"chapter_notes_html_{chapter.id}")
if chapter_text_diff:
current_app.cache.delete(f"chapter_text_html_{chapter.id}")

later(current_app.tasks['sphinx_update_chapter'].delay, chapter.id)
return chapter

Expand Down

0 comments on commit 5d2ff89

Please sign in to comment.