aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorBruce Berrios <[email protected]>2024-09-09 23:07:57 -0400
committerBruce Berrios <[email protected]>2024-09-09 23:07:57 -0400
commit0d18e34c24a5fa58b67a8a8148af11e33b0a5742 (patch)
tree04f71753d0e20e49a5fa9b5a5b5fa3cd9b8b122c
parentbf6a526678f74e32ff42a6060bcb251f0039ee84 (diff)
downloadmonkeytype-async-delete.tar.gz
monkeytype-async-delete.zip
-rw-r--r--backend/src/jobs/delete-users.ts4
-rw-r--r--backend/src/utils/misc.ts2
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[],