mirror of
https://github.com/FoxxMD/context-mod.git
synced 2026-05-11 03:00:42 -04:00
fix(delayed): Prevent delete call when no ids found
This commit is contained in:
@@ -556,11 +556,14 @@ export class SubredditResources {
|
||||
|
||||
this.logger.debug(`Marked ${activityIdsToDelete.length} Activities created, by Delayed, for deletion (${rawActCount} w/o Events | ${activeActCount} used by other Delayed Activities)`, {leaf: 'Delayed Activities'});
|
||||
|
||||
await this.dispatchedActivityRepo.delete(actualDispatchedIds);
|
||||
if(actualDispatchedIds.length > 0) {
|
||||
await this.dispatchedActivityRepo.delete(actualDispatchedIds);
|
||||
} else {
|
||||
this.logger.warn('No dispatched ids found to delete');
|
||||
}
|
||||
if(activityIdsToDelete.length > 0) {
|
||||
await this.activityRepo.delete(activityIdsToDelete);
|
||||
}
|
||||
|
||||
this.delayedItems = this.delayedItems.filter(x => !actualDispatchedIds.includes(x.id));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user