Skip to content

Commit

Permalink
fix config type
Browse files Browse the repository at this point in the history
  • Loading branch information
logica0419 committed Dec 7, 2023
1 parent 50ab701 commit 1d52ab5
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions cmd/file.go
Original file line number Diff line number Diff line change
Expand Up @@ -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))
}
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ var (
// configFile 設定ファイルyamlのパス
configFile string
// c 設定
c *Config
c Config
)

// rootコマンドはダミー。コマンドとしては使用しない
Expand Down
4 changes: 2 additions & 2 deletions cmd/serve.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down Expand Up @@ -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))
}
Expand Down
2 changes: 1 addition & 1 deletion cmd/stamp.go
Original file line number Diff line number Diff line change
Expand Up @@ -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))
}
Expand Down

0 comments on commit 1d52ab5

Please sign in to comment.