mirror of
https://github.com/mii443/wasmer.git
synced 2025-12-07 21:28:21 +00:00
feat(backend-api): Add app cache purging
This commit is contained in:
@@ -1137,6 +1137,20 @@ pub fn get_all_dns_records_stream(
|
||||
)
|
||||
}
|
||||
|
||||
pub async fn purge_cache_for_app_version(
|
||||
client: &WasmerClient,
|
||||
vars: types::PurgeCacheForAppVersionVars,
|
||||
) -> Result<(), anyhow::Error> {
|
||||
client
|
||||
.run_graphql_strict(types::PurgeCacheForAppVersion::build(vars))
|
||||
.await
|
||||
.map_err(anyhow::Error::from)
|
||||
.map(|x| x.purge_cache_for_app_version)
|
||||
.context("backend did not return data")?;
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
/// Convert a [`OffsetDateTime`] to a unix timestamp that the WAPM backend
|
||||
/// understands.
|
||||
fn unix_timestamp(ts: OffsetDateTime) -> f64 {
|
||||
|
||||
Reference in New Issue
Block a user