MCPcopy Create free account
hub / github.com/CreminiAI/skillpack / updateWithRetry

Method updateWithRetry

src/runtime/adapters/slack.ts:607–637  ·  view source on GitHub ↗
(
    client: any,
    route: SlackRoute,
    ts: string,
    text: string,
    maxRetries = 3,
  )

Source from the content-addressed store, hash-verified

605 }
606
607 private async updateWithRetry(
608 client: any,
609 route: SlackRoute,
610 ts: string,
611 text: string,
612 maxRetries = 3,
613 ): Promise<void> {
614 for (let attempt = 0; attempt <= maxRetries; attempt++) {
615 try {
616 await client.chat.update({
617 channel: route.channel,
618 ts,
619 text: formatSlackMessage(text),
620 mrkdwn: true,
621 });
622 return;
623 } catch (err: any) {
624 const retryAfter = this.getRetryAfterSeconds(err);
625 if (retryAfter && attempt < maxRetries) {
626 console.log(
627 `[Slack] Rate limited while updating, retrying after ${retryAfter}s...`,
628 );
629 await new Promise((resolve) =>
630 setTimeout(resolve, retryAfter * 1000),
631 );
632 continue;
633 }
634 throw err;
635 }
636 }
637 }
638
639 private async deleteMessageSafe(
640 client: any,

Callers 1

updateMessageSafeMethod · 0.95

Calls 2

getRetryAfterSecondsMethod · 0.95
formatSlackMessageFunction · 0.85

Tested by

no test coverage detected