Skip to content

Commit b50512e

Browse files
DavideViolantemanast
authored andcommitted
chore: exec npm run prettier
1 parent 236f812 commit b50512e

File tree

4 files changed

+12
-15
lines changed

4 files changed

+12
-15
lines changed

lib/commands/index.js

+7-5
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,9 @@ module.exports = (function() {
3131
await utils.isRedisReady(client);
3232
scripts = await (scripts || loadScripts(__dirname));
3333

34-
return scripts.map(({ name, options }) => client.defineCommand(name, options));
34+
return scripts.map(({ name, options }) =>
35+
client.defineCommand(name, options)
36+
);
3537
};
3638
})();
3739

@@ -46,17 +48,17 @@ async function loadScripts(dir) {
4648
throw new Error('No .lua files found!');
4749
}
4850
return Promise.all(
49-
luaFiles.map(async (file) => {
51+
luaFiles.map(async file => {
5052
const lua = await _fs.readFileAsync(path.join(dir, file));
5153
const longName = path.basename(file, '.lua');
5254

5355
return {
5456
name: longName.split('-')[0],
5557
options: {
5658
numberOfKeys: parseInt(longName.split('-')[1]),
57-
lua: lua.toString(),
58-
},
59+
lua: lua.toString()
60+
}
5961
};
60-
}),
62+
})
6163
);
6264
}

lib/getters.js

+2-3
Original file line numberDiff line numberDiff line change
@@ -91,15 +91,14 @@ module.exports = function(Queue) {
9191
};
9292

9393
/**
94-
*
94+
*
9595
* @returns the potential stalled jobs. Only useful for tests.
9696
*/
9797
Queue.prototype.getStalledCount = function() {
9898
const key = this.toKey('stalled');
9999
return this.client.scard(key);
100100
};
101101

102-
103102
// TO BE DEPRECATED --->
104103
Queue.prototype.getPausedCount = function() {
105104
return this.getJobCountByTypes('paused');
@@ -196,7 +195,7 @@ module.exports = function(Queue) {
196195
return {
197196
logs: result[0][1],
198197
count: result[1][1]
199-
}
198+
};
200199
});
201200
};
202201
};

test/test_job.js

+2-6
Original file line numberDiff line numberDiff line change
@@ -555,9 +555,7 @@ describe('Job', () => {
555555
expect(logs).to.be.eql({ logs: [firstLog, secondLog], count: 2 })
556556
)
557557
.then(() => queue.getJobLogs(job.id, 1, 1))
558-
.then(logs =>
559-
expect(logs).to.be.eql({ logs: [secondLog], count: 2 })
560-
)
558+
.then(logs => expect(logs).to.be.eql({ logs: [secondLog], count: 2 }))
561559
.then(() => queue.getJobLogs(job.id, 0, 1, false))
562560
.then(logs =>
563561
expect(logs).to.be.eql({ logs: [secondLog, firstLog], count: 2 })
@@ -567,9 +565,7 @@ describe('Job', () => {
567565
expect(logs).to.be.eql({ logs: [secondLog, firstLog], count: 2 })
568566
)
569567
.then(() => queue.getJobLogs(job.id, 1, 1, false))
570-
.then(logs =>
571-
expect(logs).to.be.eql({ logs: [firstLog], count: 2 })
572-
)
568+
.then(logs => expect(logs).to.be.eql({ logs: [firstLog], count: 2 }))
573569
.then(() => job.remove())
574570
.then(() => queue.getJobLogs(job.id))
575571
.then(logs => expect(logs).to.be.eql({ logs: [], count: 0 }))

test/test_queue.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1485,7 +1485,7 @@ describe('Queue', () => {
14851485
.catch(done);
14861486
});
14871487

1488-
it('should clear job from stalled set when job completed', (done) => {
1488+
it('should clear job from stalled set when job completed', done => {
14891489
const queue2 = utils.buildQueue('running-job-' + uuid.v4(), {
14901490
settings: {
14911491
stalledInterval: 10

0 commit comments

Comments
 (0)