Skip to content
This repository was archived by the owner on Mar 25, 2019. It is now read-only.

Commit 9e75228

Browse files
author
Sjoerd Tieleman
committed
Return a job from memory if it is still active.
1 parent c86e59d commit 9e75228

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

lib/job-handler.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,13 @@ var os = require('os'),
88
var slots = [];
99

1010
exports.find = function(id, callback) {
11+
for (var item in slots) {
12+
if (slots[item].internalId == id) {
13+
callback(null, slots[item]);
14+
return;
15+
}
16+
}
17+
1118
Job.find({ where: { internalId: id }}).success(function(job) {
1219
callback(null, job);
1320
}).error(function(err) {

0 commit comments

Comments
 (0)