From 6cb3313793bf45e197b3048f0abd2f600bf97bb5 Mon Sep 17 00:00:00 2001 From: alex Date: Sun, 12 Jul 2026 15:00:16 +0200 Subject: multi exec and discard --- pkg/core/shards.go | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'pkg/core') diff --git a/pkg/core/shards.go b/pkg/core/shards.go index 5ede61c..1732be5 100644 --- a/pkg/core/shards.go +++ b/pkg/core/shards.go @@ -131,4 +131,15 @@ func ( db *RedisDB) Unlock(keys []string){ for i := len(sortedIDs)-1; i >= 0; i --{ shardMap[sortedIDs[i]].Mu.Unlock() } +} + +func (db *RedisDB)LockAll(){ + for _, shard := range db.Shards { + shard.Mu.Lock() + } +} +func (db *RedisDB)UnlockAll(){ + for i := len(db.Shards)-1;i >= 0; i --{ + db.Shards[i].Mu.Unlock() + } } \ No newline at end of file -- cgit v1.2.3