Skip to content

Commit

Permalink
feat: parallelize ddb/rds write
Browse files Browse the repository at this point in the history
  • Loading branch information
ecxyzzy committed Dec 3, 2024
1 parent 84b9e32 commit 73113ed
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions apps/backend/src/routers/users.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,12 +59,9 @@ const usersRouter = router({

// Mangle duplicate schedule names
data.userData.schedules = mangleDuplicateScheduleNames(data.userData.schedules);

// Don't await because the show must go on without RDS.
RDS.upsertGuestUserData(db, data)
.catch((error) => console.error('Failed to upsert user data:', error));

return ddbClient.insertItem(data);
return Promise.all([ddbClient.insertItem(data), RDS.upsertGuestUserData(db, data)
.catch((error) => console.error('Failed to upsert user data:', error))]);
}
),

Expand Down

0 comments on commit 73113ed

Please sign in to comment.