From 1d52ab570b313bace70582500a00a04cba071c25 Mon Sep 17 00:00:00 2001 From: logica0419 <84759675+logica0419@users.noreply.github.com> Date: Fri, 8 Dec 2023 04:49:10 +0900 Subject: [PATCH] fix config type --- cmd/file.go | 6 +++--- cmd/root.go | 2 +- cmd/serve.go | 4 ++-- cmd/stamp.go | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/cmd/file.go b/cmd/file.go index aebb0596f..e1c30a9b0 100644 --- a/cmd/file.go +++ b/cmd/file.go @@ -75,7 +75,7 @@ func filePruneCommand() *cobra.Command { } // FileManager - fm, err := file.InitFileManager(repo, fs, imaging.NewProcessor(provideImageProcessorConfig(c)), logger) + fm, err := file.InitFileManager(repo, fs, imaging.NewProcessor(provideImageProcessorConfig(&c)), logger) if err != nil { logger.Fatal("failed to initialize file manager", zap.Error(err)) } @@ -176,7 +176,7 @@ func genMissingThumbnails() *cobra.Command { } // ImageProcessor - ip := imaging.NewProcessor(provideImageProcessorConfig(c)) + ip := imaging.NewProcessor(provideImageProcessorConfig(&c)) generateImageThumb := func(file *model.FileMeta) error { fid := file.ID @@ -374,7 +374,7 @@ func genGroupImages() *cobra.Command { } // ImageProcessor - ip := imaging.NewProcessor(provideImageProcessorConfig(c)) + ip := imaging.NewProcessor(provideImageProcessorConfig(&c)) // FileManager fm, err := file.InitFileManager(repo, fs, ip, logger) diff --git a/cmd/root.go b/cmd/root.go index 4f2f59ed9..5bf82dc18 100644 --- a/cmd/root.go +++ b/cmd/root.go @@ -29,7 +29,7 @@ var ( // configFile 設定ファイルyamlのパス configFile string // c 設定 - c *Config + c Config ) // rootコマンドはダミー。コマンドとしては使用しない diff --git a/cmd/serve.go b/cmd/serve.go index bd8b6fc88..e0813fc1a 100644 --- a/cmd/serve.go +++ b/cmd/serve.go @@ -42,7 +42,7 @@ func serveCommand() *cobra.Command { // Stackdriver Profiler if c.GCP.Stackdriver.Profiler.Enabled { - if err := initStackdriverProfiler(c); err != nil { + if err := initStackdriverProfiler(&c); err != nil { logger.Fatal("failed to setup Stackdriver Profiler", zap.Error(err)) } logger.Info("stackdriver profiler started") @@ -98,7 +98,7 @@ func serveCommand() *cobra.Command { } // サーバー作成 - server, err := newServer(hub, engine, repo, fs, logger, c) + server, err := newServer(hub, engine, repo, fs, logger, &c) if err != nil { logger.Fatal("failed to create server", zap.Error(err)) } diff --git a/cmd/stamp.go b/cmd/stamp.go index b32d9ac50..1c56f9748 100644 --- a/cmd/stamp.go +++ b/cmd/stamp.go @@ -62,7 +62,7 @@ func stampInstallEmojisCommand() *cobra.Command { if err != nil { logger.Fatal("failed to initialize repository", zap.Error(err)) } - fm, err := file.InitFileManager(repo, fs, imaging.NewProcessor(provideImageProcessorConfig(c)), logger) + fm, err := file.InitFileManager(repo, fs, imaging.NewProcessor(provideImageProcessorConfig(&c)), logger) if err != nil { logger.Fatal("failed to initialize file manager", zap.Error(err)) }