Skip to content

Commit

Permalink
Fix: fixes cleanup sort
Browse files Browse the repository at this point in the history
  • Loading branch information
pustovitDmytro committed Jul 26, 2022
1 parent 2157da1 commit e8fa18f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/workers/cleanup.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export default async function () {

pn.progress(accum += perQueue * 0.25, `Found ${jobs.length} completed jobs for ${Queue.name}`);

jobs.sort((a, b) => a.finishedOn - b.finishedOn);
jobs.sort((a, b) => b.finishedOn - a.finishedOn);
const needRemove = jobs.slice(Queue.keepLast, jobs.length);

pn.progress(accum += perQueue * 0.1, `${needRemove.length} jobs will be removed for ${Queue.name}`);
Expand Down

0 comments on commit e8fa18f

Please sign in to comment.