This commit is contained in:
Albert Espín 2024-10-03 00:32:27 +02:00
parent 130dfb682a
commit ca9dbcd1f2

View File

@ -3,6 +3,7 @@ package storage
import ( import (
"context" "context"
"fmt" "fmt"
"sync"
"git.espin.casa/albert/cml04-falcon-system/internal/types" "git.espin.casa/albert/cml04-falcon-system/internal/types"
"gorm.io/driver/postgres" "gorm.io/driver/postgres"
@ -18,6 +19,7 @@ type Storager interface {
type storage struct { type storage struct {
db *gorm.DB db *gorm.DB
mux sync.RWMutex
} }
type DBConfig struct { type DBConfig struct {
@ -89,5 +91,6 @@ func New(conf *DBConfig) (Storager, error) {
// done // done
return &storage{ return &storage{
db: db, db: db,
mux: sync.RWMutex{},
}, nil }, nil
} }