mirror of
https://github.com/natsukagami/youmubot.git
synced 2025-05-24 17:20:49 +00:00
Add cache clear command
This commit is contained in:
parent
7d00b95a4f
commit
b5013b9899
4 changed files with 45 additions and 1 deletions
|
@ -218,6 +218,13 @@ impl CachedBeatmap {
|
|||
.await
|
||||
.map_err(Error::from)
|
||||
}
|
||||
|
||||
/// Delete all of the caches.
|
||||
pub async fn clear_all(conn: impl Executor<'_, Database = Database>) -> Result<()> {
|
||||
conn.execute("DELETE FROM osu_cached_beatmapsets; DELETE FROM osu_cached_beatmaps;")
|
||||
.await?;
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
|
||||
impl CachedBeatmap {
|
||||
|
@ -291,6 +298,13 @@ impl CachedBeatmapContent {
|
|||
.await
|
||||
.map_err(Error::from)
|
||||
}
|
||||
|
||||
/// Delete all of the caches.
|
||||
pub async fn clear_all(conn: impl Executor<'_, Database = Database>) -> Result<()> {
|
||||
conn.execute("DELETE FROM osu_cached_beatmap_contents;")
|
||||
.await?;
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
|
||||
impl CachedBeatmapContent {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue