diff --git a/internal/storage/storage.go b/internal/storage/storage.go index 87ddc47..ef39543 100644 --- a/internal/storage/storage.go +++ b/internal/storage/storage.go @@ -3,6 +3,7 @@ package storage import ( "context" "fmt" + "sync" "git.espin.casa/albert/cml04-falcon-system/internal/types" "gorm.io/driver/postgres" @@ -17,7 +18,8 @@ type Storager interface { } type storage struct { - db *gorm.DB + db *gorm.DB + mux sync.RWMutex } type DBConfig struct { @@ -88,6 +90,7 @@ func New(conf *DBConfig) (Storager, error) { } // done return &storage{ - db: db, + db: db, + mux: sync.RWMutex{}, }, nil }