feat: update retry algorithm for qstash
avoids dlq until it has to
This commit is contained in:
@@ -7,7 +7,7 @@ const GetNextEpisodeAiringAtQuery = graphql(`
|
||||
status
|
||||
nextAiringEpisode {
|
||||
episode
|
||||
timeUntilAiring
|
||||
airingAt
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -37,15 +37,14 @@ export async function maybeScheduleNextAiringEpisode(
|
||||
return;
|
||||
}
|
||||
|
||||
const { timeUntilAiring, episode: nextEpisode } = nextAiring;
|
||||
const { airingAt, episode: nextEpisode } = nextAiring;
|
||||
const client = new Client({ token: env.QSTASH_TOKEN });
|
||||
|
||||
const { messageId } = await client.publishJSON({
|
||||
url: `${domain}/internal/new-episode`,
|
||||
body: { aniListId, episodeNumber: nextEpisode },
|
||||
retries: 0,
|
||||
delay: timeUntilAiring,
|
||||
contentBasedDeduplication: true,
|
||||
retries: 6,
|
||||
notBefore: airingAt,
|
||||
});
|
||||
await Promise.allSettled([
|
||||
setTitleMessage(env, aniListId, messageId),
|
||||
|
||||
Reference in New Issue
Block a user