Fix thread cleaner forgetting to clean some thread and messages

This commit is contained in:
Charles Bochet
2024-06-01 16:51:20 +02:00
parent 182ab66eef
commit c4b6b1e076

View File

@ -16,13 +16,12 @@ export const deleteUsingPagination = async (
) => Promise<void>, ) => Promise<void>,
transactionManager?: EntityManager, transactionManager?: EntityManager,
) => { ) => {
let offset = 0;
let hasMoreData = true; let hasMoreData = true;
while (hasMoreData) { while (hasMoreData) {
const idsToDelete = await getterPaginated( const idsToDelete = await getterPaginated(
batchSize, batchSize,
offset, 0,
workspaceId, workspaceId,
transactionManager, transactionManager,
); );
@ -32,7 +31,5 @@ export const deleteUsingPagination = async (
} else { } else {
hasMoreData = false; hasMoreData = false;
} }
offset += batchSize;
} }
}; };