diff options
author | Bruce Berrios <[email protected]> | 2024-09-09 23:07:57 -0400 |
---|---|---|
committer | Bruce Berrios <[email protected]> | 2024-09-09 23:07:57 -0400 |
commit | 0d18e34c24a5fa58b67a8a8148af11e33b0a5742 (patch) | |
tree | 04f71753d0e20e49a5fa9b5a5b5fa3cd9b8b122c | |
parent | bf6a526678f74e32ff42a6060bcb251f0039ee84 (diff) | |
download | monkeytype-0d18e34c24a5fa58b67a8a8148af11e33b0a5742.tar.gz monkeytype-0d18e34c24a5fa58b67a8a8148af11e33b0a5742.zip |
fixesasync-delete
-rw-r--r-- | backend/src/jobs/delete-users.ts | 4 | ||||
-rw-r--r-- | backend/src/utils/misc.ts | 2 |
2 files changed, 2 insertions, 4 deletions
diff --git a/backend/src/jobs/delete-users.ts b/backend/src/jobs/delete-users.ts index 2d8e57b47..f9f9121da 100644 --- a/backend/src/jobs/delete-users.ts +++ b/backend/src/jobs/delete-users.ts @@ -59,9 +59,7 @@ async function deleteUsers(): Promise<void> { return; } - await mapLimit(softDeletedUsers, CONCURRENT_DELETIONS, async (user) => { - await deleteUser(user.uid); - }); + await mapLimit(softDeletedUsers, CONCURRENT_DELETIONS, async (user) => deleteUser(user.uid)); } export default new CronJob(CRON_SCHEDULE, deleteUsers); diff --git a/backend/src/utils/misc.ts b/backend/src/utils/misc.ts index a5ee6e1dd..1057a15d3 100644 --- a/backend/src/utils/misc.ts +++ b/backend/src/utils/misc.ts @@ -344,7 +344,7 @@ export function replaceObjectIds<T extends { _id: ObjectId }>( return data.map((it) => replaceObjectId(it)); } -type MapLimitIteratee<T, V> = (element: T, index: number) => V; +type MapLimitIteratee<T, V> = (element: T, index: number) => Promise<V>; export async function mapLimit<T, V>( input: T[], |