Skip to content

Commit 9a258e7

Browse files
committed
Bug fixes
1 parent 521d70f commit 9a258e7

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

package/server/imports/actions/add/index.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ var add = function () {
2929
arguments: input.arguments
3030
})
3131

32-
3332
if (doc) blockAdd = true
3433
}
3534

@@ -52,10 +51,14 @@ var add = function () {
5251
var doc = Utilities.collection.findOne({
5352
name: input.name,
5453
arguments: input.arguments,
54+
state: {
55+
$in: ["pending", "failure"]
56+
}
5557
})
5658

5759
if (doc) {
58-
var initDate = jobDoc.created || new Date;
60+
console.log(doc)
61+
var initDate = jobDoc.due || new Date;
5962

6063
jobId = Utilities.collection.update(doc._id, {
6164
$set: {

package/server/imports/actions/execute/toolbelt.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ var toolbelt = function (jobDoc) {
4545
}
4646
}
4747

48-
return this.document.data[key] || null;
48+
return this.document.data[key];
4949
}
5050

5151
this.push = function (key, value) {

0 commit comments

Comments
 (0)