improve initialization flow

This commit is contained in:
yusing
2025-02-15 11:21:29 +08:00
parent 9731d28ec3
commit 01432fa778
9 changed files with 82 additions and 81 deletions

View File

@@ -36,7 +36,7 @@ func InitIconCache() {
if err != nil {
logging.Error().Err(err).Msg("failed to load icon cache")
} else {
logging.Info().Msgf("icon cache loaded (%d icons)", len(iconCache))
logging.Info().Int("count", len(iconCache)).Msg("icon cache loaded")
}
go func() {

View File

@@ -56,7 +56,7 @@ func List(cfg config.ConfigInstance, w http.ResponseWriter, r *http.Request) {
case ListMatchDomains:
gphttp.RespondJSON(w, r, cfg.Value().MatchDomains)
case ListHomepageConfig:
gphttp.RespondJSON(w, r, routequery.HomepageConfig(cfg.Value().Homepage.UseDefaultCategories, r.FormValue("category"), r.FormValue("provider")))
gphttp.RespondJSON(w, r, routequery.HomepageConfig(r.FormValue("category"), r.FormValue("provider")))
case ListRouteProviders:
gphttp.RespondJSON(w, r, cfg.RouteProviderList())
case ListHomepageCategories: