Skip to content

Commit

Permalink
feat: add trimEvents method to queue client
Browse files Browse the repository at this point in the history
  • Loading branch information
manast committed Sep 29, 2019
1 parent dbb66cd commit b7da7c4
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/classes/queue.ts
Original file line number Diff line number Diff line change
Expand Up @@ -171,4 +171,9 @@ export class Queue extends QueueGetters {
this.emit('cleaned', jobs, type);
return jobs;
}

async trimEvents(maxLength: number) {
await this.waitUntilReady();
return this.client.xtrim(this.keys.events, 'MAXLEN', '~', maxLength);
}
}

0 comments on commit b7da7c4

Please sign in to comment.