redis bump

This commit is contained in:
Djkáťo 2024-04-15 19:51:37 +02:00
parent 8e142c813d
commit 1db7ae5263
2 changed files with 4 additions and 3 deletions

View file

@ -132,7 +132,7 @@ impl XmlCache {
*/ */
pub async fn delete_all(&self, saleor_api_url: &str) -> anyhow::Result<()> { pub async fn delete_all(&self, saleor_api_url: &str) -> anyhow::Result<()> {
debug!("xml data delete_cache()"); debug!("xml data delete_cache()");
let mut conn = self.client.get_async_connection().await?; let mut conn = self.client.get_multiplexed_async_connection().await?;
conn.del(self.prepare_key(saleor_api_url)).await?; conn.del(self.prepare_key(saleor_api_url)).await?;
info!("sucessful cache wipe"); info!("sucessful cache wipe");
@ -141,7 +141,7 @@ impl XmlCache {
pub async fn get_all(&self, saleor_api_url: &str) -> anyhow::Result<Vec<XmlData>> { pub async fn get_all(&self, saleor_api_url: &str) -> anyhow::Result<Vec<XmlData>> {
debug!("xml data get_all()"); debug!("xml data get_all()");
let mut conn = self.client.get_async_connection().await?; let mut conn = self.client.get_multiplexed_async_connection().await?;
let res: Vec<u8> = conn.get(self.prepare_key(saleor_api_url)).await?; let res: Vec<u8> = conn.get(self.prepare_key(saleor_api_url)).await?;
let cache: Vec<XmlData> = serde_cbor::from_slice(&res)?; let cache: Vec<XmlData> = serde_cbor::from_slice(&res)?;
@ -152,7 +152,7 @@ impl XmlCache {
pub async fn set(&self, data: Vec<XmlData>, saleor_api_url: &str) -> anyhow::Result<()> { pub async fn set(&self, data: Vec<XmlData>, saleor_api_url: &str) -> anyhow::Result<()> {
debug!("xml data set()"); debug!("xml data set()");
let mut conn = self.client.get_async_connection().await?; let mut conn = self.client.get_multiplexed_async_connection().await?;
conn.set(self.prepare_key(saleor_api_url), serde_cbor::to_vec(&data)?) conn.set(self.prepare_key(saleor_api_url), serde_cbor::to_vec(&data)?)
.await?; .await?;
info!("sucessful cache set"); info!("sucessful cache set");

View file

@ -42,6 +42,7 @@ pub async fn webhooks(
.to_owned(); .to_owned();
let event_type = get_webhook_event_type(&headers)?; let event_type = get_webhook_event_type(&headers)?;
if let EitherWebhookType::Async(a) = event_type { if let EitherWebhookType::Async(a) = event_type {
// TODO: Extract this into a function so You can check what the error was if something fails
match a { match a {
AsyncWebhookEventType::ProductUpdated AsyncWebhookEventType::ProductUpdated
| AsyncWebhookEventType::ProductCreated | AsyncWebhookEventType::ProductCreated