Skip to content

Commit

Permalink
refactor: cron job gd exports error after update (#378)
Browse files Browse the repository at this point in the history
  • Loading branch information
JBR90 authored Nov 27, 2024
1 parent b40def9 commit 4cb2e45
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
15 changes: 7 additions & 8 deletions apps/nextjs/src/app/api/cron-jobs/expired-exports/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,14 +54,13 @@ async function updateExpiredAtAndDelete(fileIds: string[]) {
log.error(`Error processing file with gdriveFileId: ${id}`, error);
failedIds.push(id);
}

if (failedIds.length > 0) {
const errorMessage = `Failed to process the following file IDs: ${failedIds.join(
", ",
)}`;
log.error(errorMessage);
throw new Error(errorMessage);
}
}
if (failedIds.length > 0) {
const errorMessage = `Failed to process the following file IDs: ${failedIds.join(
", ",
)}`;
log.error(errorMessage);
throw new Error(errorMessage);
}
}

Expand Down
2 changes: 1 addition & 1 deletion packages/api/src/router/testSupport/prepareUser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ const generateEmailAddress = (personaName: keyof typeof personas) => {
// All users use the "[email protected]" mailbox with a `+` alias
"test",
// Replace non-alphanumeric characters with -
branch.replace(/\W+/g, "-"),
branch.replace(/\W+/g, "-").slice(-15),
// A new login for each persona
personaName,
// Allows signing in with the email_code strategy
Expand Down

0 comments on commit 4cb2e45

Please sign in to comment.