mirror of
https://github.com/modrinth/code.git
synced 2026-08-27 10:04:52 +00:00
* chore(labrinth): bump to redis 1.4.1 * feat(labrinth): redis cluster * chore: cleanup * feat(labrinth): cache locking * fix(labrinth): clippy * chore(labrinth): cleanup env, remove postcard support * chore(ci): fix test env for labrinth * chore(labrinth): bump all key versions * chore(labrinth): improve redis key identities handling * chore(labrinth): simplify deadline handling * chore(labrinth): remove unused lease tracking * chore(labrinth): remove distributed cache locking for now * chore(labrinth): improve redis backend init error * feat(labrinth): expose redis read replica strategy * chore(ci): remove other connection mode tests * chore: split xredis crate * feat(xredis): primaries routing * chore: tombi fmt * chore: clippy * chore: update query cache
18 lines
496 B
Rust
18 lines
496 B
Rust
mod local;
|
|
|
|
use std::time::Duration;
|
|
|
|
pub(super) use self::local::{LockAcquisition, LockCoordinator, LockWaiter};
|
|
|
|
pub(super) const WAIT_TIMEOUT: Duration = Duration::from_secs(5);
|
|
|
|
/// Normalize only the requested lookup form's case. Raw IDs and aliases remain
|
|
/// distinct lock identities and may therefore fill concurrently.
|
|
pub(super) fn normalize_key(key: &str, case_sensitive: bool) -> String {
|
|
if case_sensitive {
|
|
key.to_owned()
|
|
} else {
|
|
key.to_lowercase()
|
|
}
|
|
}
|