From da66e7b9e3fa09623193306ecad4799863840cf0 Mon Sep 17 00:00:00 2001 From: Kyle Espinola Date: Mon, 23 Oct 2023 14:53:31 +0200 Subject: [PATCH] fix: clear the supply cache on the collection when queue mint is called --- api/src/mutations/mint.rs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/api/src/mutations/mint.rs b/api/src/mutations/mint.rs index fe2ea69..feb84c2 100644 --- a/api/src/mutations/mint.rs +++ b/api/src/mutations/mint.rs @@ -875,10 +875,13 @@ impl Mutation { ctx: &Context<'_>, input: QueueMintToDropInput, ) -> Result { - let AppContext { db, user_id, .. } = ctx.data::()?; + let AppContext { + db, user_id, redis, .. + } = ctx.data::()?; let conn = db.get(); + let mut redis_conn = redis.get_async_connection().await?; let metadata_json_upload_job_queue = ctx.data::()?; let nfts_producer = ctx.data::>()?; @@ -943,6 +946,10 @@ impl Mutation { }) .await?; + redis_conn + .del(format!("collection:{}:supply", drop.collection_id)) + .await?; + nfts_producer .send( Some(&NftEvents {