We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent ae7cf2a commit 8860c8dCopy full SHA for 8860c8d
1 file changed
cache.go
@@ -314,6 +314,9 @@ func (a *AtomicCache) Delete(key string) error {
314
}
315
316
shardSection := a.getShardsSectionByID(val.ShardSection)
317
+ // Check if the shard at val.ShardIndex is nil. This is a defensive check to
318
+ // handle cases where the shard might have been released or not initialized
319
+ // due to concurrent modifications or unexpected states.
320
if shardSection.shards[val.ShardIndex] != nil {
321
shardSection.shards[val.ShardIndex].Free(val.RecordIndex)
322
a.releaseShard(val.ShardSection, val.ShardIndex)
0 commit comments