Replace Redis with Valkey in docker-compose files and fix Rust 2024 compat

Swap redis:7-alpine images to valkey/valkey:7-alpine across all
docker-compose files and example READMEs. Keep service name as
"redis" so that the default REDIS=redis://redis/ connection string
still resolves correctly in Docker networking.

Also add turbofish type annotations to redis crate calls in store.rs
for Rust 2024 never-type-fallback compatibility, and fix a typo
("notion" -> "note") in an error message.
This commit is contained in:
Stefan Meinecke
2026-05-12 18:39:03 +02:00
parent 482795dd9a
commit 1a243cc96a
6 changed files with 22 additions and 22 deletions
+4 -4
View File
@@ -31,13 +31,13 @@ pub fn set(id: &String, note: &Note) -> Result<(), &'static str> {
let serialized = serde_json::to_string(&note.clone()).unwrap();
let mut conn = get_connection()?;
conn.set(id, serialized)
conn.set::<_, _, ()>(id, serialized)
.map_err(|_| "Unable to set note in redis")?;
match note.expiration {
Some(e) => {
let seconds = e - now();
conn.expire(id, seconds as i64)
.map_err(|_| "Unable to set expiration on notion")?
conn.expire::<_, ()>(id, seconds as i64)
.map_err(|_| "Unable to set expiration on note")?
}
None => {}
};
@@ -58,6 +58,6 @@ pub fn get(id: &String) -> Result<Option<Note>, &'static str> {
pub fn del(id: &String) -> Result<(), &'static str> {
let mut conn = get_connection()?;
conn.del(id).map_err(|_| "Unable to delete note in redis")?;
conn.del::<_, ()>(id).map_err(|_| "Unable to delete note in redis")?;
Ok(())
}