mirror of
https://github.com/WJQSERVER-STUDIO/ghproxy.git
synced 2026-02-03 00:01:10 +08:00
add hub theme & add more check for wcache close
This commit is contained in:
parent
c7954ae91a
commit
6ff23f639e
1 changed files with 6 additions and 3 deletions
9
main.go
9
main.go
|
|
@ -213,6 +213,8 @@ func loadEmbeddedPages(cfg *config.Config) (fs.FS, fs.FS, error) {
|
|||
pages, err = fs.Sub(pagesFS, "pages/classic")
|
||||
case "mino":
|
||||
pages, err = fs.Sub(pagesFS, "pages/mino")
|
||||
case "hub":
|
||||
pages, err = fs.Sub(pagesFS, "pages/hub")
|
||||
default:
|
||||
pages, err = fs.Sub(pagesFS, "pages/design") // 默认主题
|
||||
logWarning("Invalid Pages Theme: %s, using default theme 'design'", cfg.Pages.Theme)
|
||||
|
|
@ -294,7 +296,7 @@ func setInternalRoute(cfg *config.Config, r *server.Hertz) error {
|
|||
staticServer.ServeHTTP(adaptor.GetCompatResponseWriter(&c.Response), req)
|
||||
})
|
||||
r.GET("/favicon.ico", func(ctx context.Context, c *app.RequestContext) {
|
||||
staticServer := http.FileServer(http.FS(pages))
|
||||
staticServer := http.FileServer(http.FS(assets))
|
||||
req, err := adaptor.GetCompatRequest(&c.Request)
|
||||
if err != nil {
|
||||
logError("%s", err)
|
||||
|
|
@ -510,8 +512,9 @@ func main() {
|
|||
http.ListenAndServe("localhost:6060", nil)
|
||||
}()
|
||||
}
|
||||
|
||||
defer wcache.StopCleanup()
|
||||
if wcache != nil {
|
||||
defer wcache.StopCleanup()
|
||||
}
|
||||
defer logger.Close()
|
||||
defer func() {
|
||||
if hertZfile != nil {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue