diff --git a/cmd/server/main.go b/cmd/server/main.go
index 375a26c407e5db424cef0e1a920f8386993dd8e0..59ea957fb60a560bf7e1d3f8c39cf748535f9332 100644
--- a/cmd/server/main.go
+++ b/cmd/server/main.go
@@ -90,13 +90,13 @@ fileScanner = worker.NewFileScanner(root, mediaRepository)
exifScanner = worker.NewEXIFScanner(root, mediaRepository)
)
- ctx, stop := signal.NotifyContext(context.Background(), os.Interrupt)
- defer stop()
-
pool := worker.NewWorkerPool()
pool.AddWorker("http server", serverWorker)
pool.AddWorker("exif scanner", worker.NewWorkerFromListProcessor[*media.Media](exifScanner, scheduler))
pool.AddWorker("file scanner", worker.NewWorkerFromChanProcessor[string](fileScanner, scheduler))
+
+ ctx, stop := signal.NotifyContext(context.Background(), os.Interrupt)
+ defer stop()
pool.Start(ctx)
pool.Wait()
diff --git a/pkg/ext/gorm_logger.go b/pkg/ext/gorm_logger.go
index bfb26d2615da4851bd9c4590350d7b0f47c7832e..bfbbb1ebfc55238016b954ad72f80d07d985311b 100644
--- a/pkg/ext/gorm_logger.go
+++ b/pkg/ext/gorm_logger.go
@@ -18,7 +18,7 @@ func getFullMsg(msg string, data ...interface{}) string {
return fmt.Sprintf(msg, append([]interface{}{utils.FileWithLineNum()}, data...)...)
}
-func (self *Log) LogMode(log logger.LogLevel) logger.Interface {
+func (self *Log) LogMode(_ logger.LogLevel) logger.Interface {
return self
}
@@ -42,7 +42,7 @@ WithContext(ctx).
Error(fullMsg)
}
-func (self *Log) Trace(ctx context.Context, begin time.Time, fc func() (sql string, rowsAffected int64), err error) {
+func (self *Log) Trace(ctx context.Context, begin time.Time, fc func() (sql string, rowsAffected int64), _ error) {
elapsed := time.Since(begin)
sql, _ := fc()
self.logrus.
diff --git a/pkg/fileop/exif.go b/pkg/fileop/exif.go
index 48e495c3dc59079fc17ddbbe4c4c1439fe3581f1..c2449adffc06db661a40e0519ab5d4ad3821f6db 100644
--- a/pkg/fileop/exif.go
+++ b/pkg/fileop/exif.go
@@ -4,8 +4,9 @@ import (
"math"
"time"
+ "github.com/barasher/go-exiftool"
+
"git.sr.ht/~gabrielgio/img/pkg/components/media"
- "github.com/barasher/go-exiftool"
)
func ReadExif(path string) (*media.MediaEXIF, error) {