1
0
Fork 0
mirror of https://github.com/Eggbertx/gochan.git synced 2025-08-18 11:46:23 -07:00

Reset views on gochan startup

This commit is contained in:
Eggbertx 2024-10-18 13:05:37 -07:00
parent c7fa173d3a
commit 7a3130635a
5 changed files with 50 additions and 4 deletions

View file

@ -77,6 +77,14 @@ func main() {
gcutil.LogFatal().Err(err).Msg("Failed to initialize the database")
}
events.TriggerEvent("db-initialized")
events.RegisterEvent([]string{"db-views-reset"}, func(trigger string, i ...interface{}) error {
gcutil.LogInfo().Msg("SQL views reset")
return nil
})
if err = gcsql.ResetViews(); err != nil {
gcutil.LogFatal().Err(err).Send()
}
parseCommandLine()
serverutil.InitMinifier()
siteCfg := config.GetSiteConfig()