Optimize Purge Command #59

Open
opened 2025-12-19 18:18:35 +00:00 by Ghost · 0 comments
Ghost commented 2025-12-19 18:18:35 +00:00 (Migrated from codeberg.org)

Refactor and optimize purge.ts. Mainly these things can be done to optimize the program:

  • The two loops can be made into one in the purgeMessages function
  • We can use promise.allSettled() instead of checking each one linearly in the fallback loop
  • When checking for user filter with a low number (say 2) it checks messages 2 at a time until it can bulk delete with the filter so it becomes slow if it has to search for a long time.
    > to fix this we could increase the fetch
## Refactor and optimize purge.ts. Mainly these things can be done to optimize the program: - The two loops can be made into one in the purgeMessages function - We can use promise.allSettled() instead of checking each one linearly in the fallback loop - When checking for user filter with a low number (say 2) it checks messages 2 at a time until it can bulk delete with the filter so it becomes slow if it has to search for a long time. > to fix this we could increase the fetch
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
ScottyLabs/dalmatian#59
No description provided.