重构项目

This commit is contained in:
dragon
2025-11-12 13:50:38 +08:00
parent dd6b50ba9c
commit adb9bf25b8
11 changed files with 217 additions and 257 deletions

View File

@@ -10,6 +10,7 @@ import (
"syscall"
"go.uber.org/zap"
"gopkg.d7z.net/gitea-pages/pkg/core"
"gopkg.in/yaml.v3"
"gopkg.d7z.net/gitea-pages/pkg"
@@ -64,7 +65,10 @@ func main() {
if err != nil {
log.Fatalln(err)
}
giteaServer := pkg.NewPageServer(gitea, *options)
backend := core.NewCacheBackend(gitea, options.CacheMeta, options.CacheMetaTTL,
options.CacheBlob, options.CacheBlobLimit,
)
giteaServer := pkg.NewPageServer(backend, *options)
defer giteaServer.Close()
ctx, stop := signal.NotifyContext(context.Background(), os.Interrupt, syscall.SIGTERM, syscall.SIGQUIT)
defer stop()