mirror of
https://github.com/Theodor-Springmann-Stiftung/musenalm.git
synced 2026-02-04 02:25:30 +00:00
BUGFIX: keep fts5 tables syncronized
This commit is contained in:
@@ -151,6 +151,18 @@ func (p *AlmanachNewPage) POSTSave(engine *templating.Engine, app core.App) Hand
|
||||
})
|
||||
}
|
||||
|
||||
// Update FTS5 index asynchronously
|
||||
go func(appInstance core.App, entryID string) {
|
||||
freshEntry, err := dbmodels.Entries_ID(appInstance, entryID)
|
||||
if err != nil {
|
||||
appInstance.Logger().Error("Failed to load entry for FTS5 update", "entry_id", entryID, "error", err)
|
||||
return
|
||||
}
|
||||
if err := updateEntryFTS5(appInstance, freshEntry); err != nil {
|
||||
appInstance.Logger().Error("Failed to update FTS5 index for new entry", "entry_id", entryID, "error", err)
|
||||
}
|
||||
}(app, entry.Id)
|
||||
|
||||
redirect := "/"
|
||||
if entry != nil {
|
||||
redirect = "/almanach/" + strconv.Itoa(entry.MusenalmID()) + "/edit?saved_message=" + url.QueryEscape("Änderungen gespeichert.")
|
||||
|
||||
Reference in New Issue
Block a user