Skip to content

Commit 4eb6a52

Browse files
committed
Fixed length ID
1 parent 1ad9874 commit 4eb6a52

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

queue.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ class Queue extends EventEmitter {
5050
// generate 16 digit job id
5151
let d = Date.now().toString()
5252
let r = Math.floor(Math.random() * 1000).toString()
53-
let id = Number(r.padStart(3, '0') + d)
53+
let id = Number((r + d).padEnd(16, '0'))
5454
this.pile.push(new Job(id, data)); // add to bottom of pile
5555
console.log('Job added (' + this.pile.length + ' on pile)')
5656
this.next(); // Start next job if idle

0 commit comments

Comments
 (0)