mirror of
https://github.com/muety/wakapi.git
synced 2023-08-10 21:12:56 +03:00
fix: speed up settings page (resolve #226)
This commit is contained in:
11
main.go
11
main.go
@@ -2,6 +2,7 @@ package main
|
||||
|
||||
import (
|
||||
"embed"
|
||||
"github.com/muety/wakapi/models"
|
||||
"io/fs"
|
||||
"log"
|
||||
"net"
|
||||
@@ -237,6 +238,16 @@ func main() {
|
||||
middlewares.NewFileTypeFilterMiddleware([]string{".go"})(fileServer),
|
||||
)
|
||||
|
||||
// Miscellaneous
|
||||
// Pre-warm projects cache
|
||||
allUsers, err := userService.GetAll()
|
||||
if err == nil {
|
||||
logbuch.Info("pre-warming user project cache")
|
||||
for _, u := range allUsers {
|
||||
go heartbeatService.GetEntitySetByUser(models.SummaryProject, u)
|
||||
}
|
||||
}
|
||||
|
||||
// Listen HTTP
|
||||
listen(router)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user