BUGFIX: keep fts5 tables syncronized

This commit is contained in:
Simon Martens
2026-01-10 23:29:26 +01:00
parent 05d4e559fe
commit 57bbd68123
15 changed files with 527 additions and 7 deletions

View File

@@ -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.")