Skip to content

Commit

Permalink
fix: clear the supply cache on the collection when queue mint is called
Browse files Browse the repository at this point in the history
  • Loading branch information
kespinola committed Oct 23, 2023
1 parent ff134e7 commit da66e7b
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion api/src/mutations/mint.rs
Original file line number Diff line number Diff line change
Expand Up @@ -875,10 +875,13 @@ impl Mutation {
ctx: &Context<'_>,
input: QueueMintToDropInput,
) -> Result<QueueMintToDropPayload> {
let AppContext { db, user_id, .. } = ctx.data::<AppContext>()?;
let AppContext {
db, user_id, redis, ..
} = ctx.data::<AppContext>()?;

let conn = db.get();

let mut redis_conn = redis.get_async_connection().await?;
let metadata_json_upload_job_queue = ctx.data::<JobQueue>()?;
let nfts_producer = ctx.data::<Producer<NftEvents>>()?;

Expand Down Expand Up @@ -943,6 +946,10 @@ impl Mutation {
})
.await?;

redis_conn
.del(format!("collection:{}:supply", drop.collection_id))
.await?;

nfts_producer
.send(
Some(&NftEvents {
Expand Down

0 comments on commit da66e7b

Please sign in to comment.