@akiflow/ergon
Advanced tools
Comparing version 1.0.3 to 1.0.6
@@ -18,2 +18,3 @@ import { AxiosInstance } from 'axios'; | ||
term(job: IErgonJob): Promise<void>; | ||
extend(job: IErgonJob): Promise<void>; | ||
schedule(sch: IErgonSchedule): Promise<IErgonSchedule>; | ||
@@ -20,0 +21,0 @@ triggerSchedule(id: string): Promise<void>; |
@@ -193,3 +193,3 @@ "use strict"; | ||
}, | ||
timeout: (wait + 1) * 1000, | ||
timeout: (wait + 2) * 1000, | ||
}) | ||
@@ -352,5 +352,5 @@ // NB if we are sure it's a number, we should use === | ||
}; | ||
ErgonQueue.prototype.schedule = function (sch) { | ||
ErgonQueue.prototype.extend = function (job) { | ||
return __awaiter(this, void 0, void 0, function () { | ||
var resp, e_8; | ||
var e_8; | ||
return __generator(this, function (_a) { | ||
@@ -360,6 +360,6 @@ switch (_a.label) { | ||
_a.trys.push([0, 2, , 3]); | ||
return [4 /*yield*/, this.cli.post('/schedules', encodeSchedule(sch))]; | ||
return [4 /*yield*/, this.cli.put("/jobs/".concat(job.id, "/extend"), encodeJob(job))]; | ||
case 1: | ||
resp = _a.sent(); | ||
return [2 /*return*/, decodeSchedule(resp.data)]; | ||
_a.sent(); | ||
return [2 /*return*/]; | ||
case 2: | ||
@@ -374,5 +374,5 @@ e_8 = _a.sent(); | ||
}; | ||
ErgonQueue.prototype.triggerSchedule = function (id) { | ||
ErgonQueue.prototype.schedule = function (sch) { | ||
return __awaiter(this, void 0, void 0, function () { | ||
var e_9; | ||
var resp, e_9; | ||
return __generator(this, function (_a) { | ||
@@ -382,6 +382,6 @@ switch (_a.label) { | ||
_a.trys.push([0, 2, , 3]); | ||
return [4 /*yield*/, this.cli.post("/schedules/".concat(id, "/trigger"))]; | ||
return [4 /*yield*/, this.cli.post('/schedules', encodeSchedule(sch))]; | ||
case 1: | ||
_a.sent(); | ||
return [2 /*return*/]; | ||
resp = _a.sent(); | ||
return [2 /*return*/, decodeSchedule(resp.data)]; | ||
case 2: | ||
@@ -396,3 +396,3 @@ e_9 = _a.sent(); | ||
}; | ||
ErgonQueue.prototype.deleteJobs = function (key) { | ||
ErgonQueue.prototype.triggerSchedule = function (id) { | ||
return __awaiter(this, void 0, void 0, function () { | ||
@@ -404,3 +404,3 @@ var e_10; | ||
_a.trys.push([0, 2, , 3]); | ||
return [4 /*yield*/, this.cli.delete("/jobs/".concat(key))]; | ||
return [4 /*yield*/, this.cli.post("/schedules/".concat(id, "/trigger"))]; | ||
case 1: | ||
@@ -418,3 +418,3 @@ _a.sent(); | ||
}; | ||
ErgonQueue.prototype.deleteSchedules = function (key) { | ||
ErgonQueue.prototype.deleteJobs = function (key) { | ||
return __awaiter(this, void 0, void 0, function () { | ||
@@ -426,3 +426,3 @@ var e_11; | ||
_a.trys.push([0, 2, , 3]); | ||
return [4 /*yield*/, this.cli.delete("/schedules/".concat(key))]; | ||
return [4 /*yield*/, this.cli.delete("/jobs/".concat(key))]; | ||
case 1: | ||
@@ -440,4 +440,24 @@ _a.sent(); | ||
}; | ||
ErgonQueue.prototype.deleteSchedules = function (key) { | ||
return __awaiter(this, void 0, void 0, function () { | ||
var e_12; | ||
return __generator(this, function (_a) { | ||
switch (_a.label) { | ||
case 0: | ||
_a.trys.push([0, 2, , 3]); | ||
return [4 /*yield*/, this.cli.delete("/schedules/".concat(key))]; | ||
case 1: | ||
_a.sent(); | ||
return [2 /*return*/]; | ||
case 2: | ||
e_12 = _a.sent(); | ||
console.error(e_12); | ||
throw e_12; | ||
case 3: return [2 /*return*/]; | ||
} | ||
}); | ||
}); | ||
}; | ||
return ErgonQueue; | ||
}()); | ||
exports.ErgonQueue = ErgonQueue; |
{ | ||
"name": "@akiflow/ergon", | ||
"version": "1.0.3", | ||
"version": "1.0.6", | ||
"description": "Client for Ergon job queue", | ||
@@ -5,0 +5,0 @@ "main": "./dist/ergon.js", |
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
381132
7976