mirror of
https://github.com/Theodor-Springmann-Stiftung/musenalm.git
synced 2026-02-04 10:35:30 +00:00
+caching layer for sorted alms
This commit is contained in:
@@ -190,6 +190,9 @@ func (p *AlmanachEditPage) POSTSave(engine *templating.Engine, app core.App) Han
|
||||
})
|
||||
}
|
||||
|
||||
// Invalidate sorted entries cache since entry was modified
|
||||
InvalidateSortedEntriesCache()
|
||||
|
||||
// Check if fields that affect contents changed
|
||||
contentsNeedUpdate := entry.PreferredTitle() != oldPreferredTitle ||
|
||||
entry.Year() != oldYear ||
|
||||
@@ -290,6 +293,9 @@ func (p *AlmanachEditPage) POSTDelete(engine *templating.Engine, app core.App) H
|
||||
})
|
||||
}
|
||||
|
||||
// Invalidate sorted entries cache since entry was deleted
|
||||
InvalidateSortedEntriesCache()
|
||||
|
||||
// Delete from FTS5 index asynchronously
|
||||
go func(appInstance core.App, entryID string) {
|
||||
if err := dbmodels.DeleteFTS5Entry(appInstance, entryID); err != nil {
|
||||
|
||||
Reference in New Issue
Block a user