优化
This commit is contained in:
+11
-1
@@ -18,6 +18,7 @@ import (
|
||||
"github.com/luxsin/app-api/internal/repository"
|
||||
"github.com/luxsin/app-api/internal/router"
|
||||
"github.com/luxsin/app-api/internal/search"
|
||||
"github.com/luxsin/app-api/internal/storage"
|
||||
"github.com/luxsin/app-api/internal/task"
|
||||
"github.com/luxsin/app-api/pkg/logger"
|
||||
"github.com/redis/go-redis/v9"
|
||||
@@ -78,7 +79,16 @@ func main() {
|
||||
log.Info("device persist task disabled")
|
||||
}
|
||||
|
||||
engine := router.New(log, db, searchClient, rdb, cfg.Equalize)
|
||||
s3Storage, err := storage.NewS3Storage(context.Background(), cfg.S3)
|
||||
if err != nil {
|
||||
log.Fatal("s3 client init failed", zap.Error(err))
|
||||
}
|
||||
log.Info("s3 configured",
|
||||
zap.String("bucket", cfg.S3.Bucket),
|
||||
zap.String("region", cfg.S3.Region),
|
||||
)
|
||||
|
||||
engine := router.New(log, db, searchClient, rdb, cfg.Equalize, s3Storage)
|
||||
|
||||
srv := &http.Server{
|
||||
Addr: cfg.Addr(),
|
||||
|
||||
Reference in New Issue
Block a user