You've already forked AstralRinth
forked from didirus/AstralRinth
Fix locking timeout issues
This commit is contained in:
@@ -295,7 +295,12 @@ impl RedisPool {
|
|||||||
|
|
||||||
fetch_ids.iter().for_each(|key| {
|
fetch_ids.iter().for_each(|key| {
|
||||||
pipe.atomic().set_options(
|
pipe.atomic().set_options(
|
||||||
format!("{}_{namespace}:{}/lock", self.meta_namespace, key),
|
// We store locks in lowercase because they are case insensitive
|
||||||
|
format!(
|
||||||
|
"{}_{namespace}:{}/lock",
|
||||||
|
self.meta_namespace,
|
||||||
|
key.to_lowercase()
|
||||||
|
),
|
||||||
100,
|
100,
|
||||||
SetOptions::default()
|
SetOptions::default()
|
||||||
.get(true)
|
.get(true)
|
||||||
@@ -395,7 +400,9 @@ impl RedisPool {
|
|||||||
|
|
||||||
pipe.atomic().del(format!(
|
pipe.atomic().del(format!(
|
||||||
"{}_{namespace}:{}/lock",
|
"{}_{namespace}:{}/lock",
|
||||||
self.meta_namespace, actual_slug
|
// Locks are stored in lowercase
|
||||||
|
self.meta_namespace,
|
||||||
|
actual_slug.to_lowercase()
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -408,8 +415,10 @@ impl RedisPool {
|
|||||||
ids.remove(&base62);
|
ids.remove(&base62);
|
||||||
|
|
||||||
pipe.atomic().del(format!(
|
pipe.atomic().del(format!(
|
||||||
"{}_{namespace}:{base62}/lock",
|
"{}_{namespace}:{}/lock",
|
||||||
self.meta_namespace
|
self.meta_namespace,
|
||||||
|
// Locks are stored in lowercase
|
||||||
|
base62.to_lowercase()
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -451,7 +460,8 @@ impl RedisPool {
|
|||||||
format!(
|
format!(
|
||||||
"{}_{namespace}:{}/lock",
|
"{}_{namespace}:{}/lock",
|
||||||
self.meta_namespace,
|
self.meta_namespace,
|
||||||
x.key()
|
// We lowercase key because locks are stored in lowercase
|
||||||
|
x.key().to_lowercase()
|
||||||
)
|
)
|
||||||
})
|
})
|
||||||
.collect::<Vec<_>>(),
|
.collect::<Vec<_>>(),
|
||||||
|
|||||||
Reference in New Issue
Block a user