Improved concurrency handling

This commit is contained in:
Pijus Kamandulis
2024-12-08 17:54:58 +02:00
parent 66ea859f34
commit e5ddc143f0
9 changed files with 117 additions and 3 deletions

View File

@@ -1,5 +1,7 @@
package repositorymodels
import "sync"
type Database struct {
ID string `json:"id"`
TimeStamp int64 `json:"_ts"`
@@ -101,6 +103,8 @@ type PartitionKeyRange struct {
}
type State struct {
sync.RWMutex
// Map databaseId -> Database
Databases map[string]Database `json:"databases"`