Since redis keys have the commit hash of an immutible Git commit, they do not need to have an expiry.
(
&self,
con: &mut redis_rs::Connection,
key: &Key,
set: &HashSet<ExternalId>,
)
| 176 | // Since redis keys have the commit hash of an immutible Git commit, they do not need to have |
| 177 | // an expiry. |
| 178 | fn save_downset( |
| 179 | &self, |
| 180 | con: &mut redis_rs::Connection, |
| 181 | key: &Key, |
| 182 | set: &HashSet<ExternalId>, |
| 183 | ) -> Result<()> { |
| 184 | redis_rs::transaction::<_, _, (), _>(con, &[key], |con, pipe| { |
| 185 | let set = set |
| 186 | .iter() |
| 187 | .map(ExternalId::to_string) |
| 188 | .collect::<HashSet<String>>(); |
| 189 | if set.is_empty() { |
| 190 | pipe.del(key).ignore() |
| 191 | } else { |
| 192 | pipe.sadd(key, set).ignore() |
| 193 | } |
| 194 | .query(con) |
| 195 | })?; |
| 196 | |
| 197 | Ok(()) |
| 198 | } |
| 199 | |
| 200 | fn stats_key(&self, repo_id: RepoId, commit: &str) -> String { |
| 201 | format!("stats:{repo_id}:{commit}") |
no test coverage detected