Skip to content

Commit

Permalink
Fix async drain function not writable anymore
Browse files Browse the repository at this point in the history
  • Loading branch information
KillianG committed Nov 8, 2024
1 parent 00e5091 commit fb7708e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion lib/tasks/TaskScheduler.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,9 @@ class TaskScheduler {

_getNewTaskQueue(ctx, queueKey) {
const queue = async.queue(this._processingFunc);
queue.drain = () => delete this._taskQueues[queueKey];
queue.drain(() => {
delete this._taskQueues[queueKey];
});
this._taskQueues[queueKey] = queue;
return queue;
}
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/lib/tasks/TaskScheduler.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ const assert = require('assert');

const TaskScheduler = require('../../../../lib/tasks/TaskScheduler');

describe('TaskScheduler', () => {
describe.only('TaskScheduler', () => {

Check failure on line 5 in tests/unit/lib/tasks/TaskScheduler.spec.js

View workflow job for this annotation

GitHub Actions / tests

Unexpected exclusive mocha test
it('should ensure serialization of updates with the same queue key',
done => {
const taskScheduler = new TaskScheduler(
Expand Down

0 comments on commit fb7708e

Please sign in to comment.