mirror of
https://github.com/cupcakearmy/cryptgeon.git
synced 2026-06-10 11:16:48 +00:00
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:
@@ -31,13 +31,13 @@ pub fn set(id: &String, note: &Note) -> Result<(), &'static str> {
|
||||
let serialized = serde_json::to_string(¬e.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(())
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user