Skip to content

Commit

Permalink
change DISCORD_NICKNAME_CHANGED to DISCORD_NICKNAME_UPDATED_TIME
Browse files Browse the repository at this point in the history
  • Loading branch information
prakashchoudhary07 committed Nov 3, 2023
1 parent 47259cc commit 3515c2e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/handlers/scheduledEventHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ export async function callDiscordNicknameBatchUpdate(env: env) {
const namespace = env[NAMESPACE_NAME] as unknown as KVNamespace;
let lastNicknameUpdate: string | null = '0';
try {
lastNicknameUpdate = await namespace.get('DISCORD_NICKNAME_CHANGED');
lastNicknameUpdate = await namespace.get('DISCORD_NICKNAME_UPDATED_TIME');
if (lastNicknameUpdate === null) {
throw new Error('Error while fetching KV "DISCORD_NICKNAME_CHANGED" timestamp');
throw new Error('Error while fetching KV "DISCORD_NICKNAME_UPDATED_TIME" timestamp');
}
if (!lastNicknameUpdate) {
lastNicknameUpdate = '0';
Expand Down Expand Up @@ -57,7 +57,7 @@ export async function callDiscordNicknameBatchUpdate(env: env) {
console.log(data);

try {
await namespace.put('DISCORD_NICKNAME_CHANGED', Date.now().toString());
await namespace.put('DISCORD_NICKNAME_UPDATED_TIME', Date.now().toString());
} catch (err) {
console.error('Error while trying to update the last nickname change timestamp');
}
Expand Down

0 comments on commit 3515c2e

Please sign in to comment.