Skip to content

Commit

Permalink
Merge branch 'feat/missed-progress-updates' into feat/progress-update…
Browse files Browse the repository at this point in the history
…s-services
  • Loading branch information
Ajeyakrishna-k authored Dec 12, 2023
2 parents 847c72b + 6b3717d commit a46d4d1
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
1 change: 1 addition & 0 deletions .github/workflows/production.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ jobs:
environment: production
steps:
- uses: actions/checkout@v2
- run: npm install
- uses: cloudflare/wrangler-action@2.0.0
with:
apiToken: ${{secrets.CLOUDFLARE_API_TOKEN}}
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/staging.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ jobs:
environment: staging
steps:
- uses: actions/checkout@v2
- run: npm install
- uses: cloudflare/wrangler-action@2.0.0
with:
apiToken: ${{secrets.CLOUDFLARE_API_TOKEN}}
Expand Down
8 changes: 6 additions & 2 deletions src/handlers/scheduledEventHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,12 @@ export async function callDiscordNicknameBatchUpdate(env: env) {
}

const data: NicknameUpdateResponseType = await response.json();
if (data?.data.totalUsersStatus !== 0 && data?.data.successfulNicknameUpdates === 0) {
throw new Error("Error while trying to update users' discord nickname");
if (data?.data.unsuccessfulNicknameUpdates === 0) {
try {
await namespace.put('DISCORD_NICKNAME_UPDATED_TIME', Date.now().toString());
} catch (err) {
console.error('Error while trying to update the last nickname change timestamp');
}
}

try {
Expand Down

0 comments on commit a46d4d1

Please sign in to comment.