long-task-queue-reader 0.7.2 → 0.8.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +6 -0
- package/LICENSE +21 -21
- package/README.md +57 -35
- package/bun.lock +1785 -0
- package/bunfig.toml +5 -0
- package/lib/longTaskQueueReader.js +16 -6
- package/lib/longTaskQueueReaderBuilder.js +3 -2
- package/package.json +65 -46
- package/long-task-queue-reader.sublime-project +0 -14
- package/long-task-queue-reader.sublime-workspace +0 -1993
package/bunfig.toml
ADDED
|
@@ -23,6 +23,9 @@
|
|
|
23
23
|
"job-get-messages": function() {
|
|
24
24
|
return logger.info("Obteniendo mensajes nuevas");
|
|
25
25
|
},
|
|
26
|
+
"job-early-finish-messages": function() {
|
|
27
|
+
return logger.info("Finalizo la ejecucion de mensajes antes de tiempo");
|
|
28
|
+
},
|
|
26
29
|
"job-finish-messages": function() {
|
|
27
30
|
return logger.info("Finalizo la ejecucion de mensajes");
|
|
28
31
|
},
|
|
@@ -49,10 +52,10 @@
|
|
|
49
52
|
extend(LongTaskQueueReader, superClass);
|
|
50
53
|
|
|
51
54
|
function LongTaskQueueReader(queue, arg, arg1, MessageExecutor, runner, fromPoison) {
|
|
52
|
-
var action, eventName, level, logger, ref, ref1, ref2, ref3, ref4, ref5, transports;
|
|
55
|
+
var action, eventName, level, logger, ref, ref1, ref2, ref3, ref4, ref5, ref6, transports;
|
|
53
56
|
this.queue = queue;
|
|
54
|
-
this.waitingTime = (ref = arg.waitingTime) != null ? ref : 60, this.visibilityTimeout = (ref1 = arg.visibilityTimeout) != null ? ref1 : 60, this.maxRetries = (ref2 = arg.maxRetries) != null ? ref2 : 10;
|
|
55
|
-
level = (
|
|
57
|
+
this.waitingTime = (ref = arg.waitingTime) != null ? ref : 60, this.visibilityTimeout = (ref1 = arg.visibilityTimeout) != null ? ref1 : 60, this.maxRetries = (ref2 = arg.maxRetries) != null ? ref2 : 10, this.earlyFinish = (ref3 = arg.earlyFinish) != null ? ref3 : false;
|
|
58
|
+
level = (ref4 = arg1.level) != null ? ref4 : "info", transports = (ref5 = arg1.transports) != null ? ref5 : [];
|
|
56
59
|
this.MessageExecutor = MessageExecutor;
|
|
57
60
|
this.runner = runner;
|
|
58
61
|
this.fromPoison = fromPoison;
|
|
@@ -70,9 +73,9 @@
|
|
|
70
73
|
level: level,
|
|
71
74
|
transports: transports
|
|
72
75
|
});
|
|
73
|
-
|
|
74
|
-
for (eventName in
|
|
75
|
-
action =
|
|
76
|
+
ref6 = eventsToLog(logger);
|
|
77
|
+
for (eventName in ref6) {
|
|
78
|
+
action = ref6[eventName];
|
|
76
79
|
this.on("" + eventName, action);
|
|
77
80
|
}
|
|
78
81
|
}
|
|
@@ -104,6 +107,13 @@
|
|
|
104
107
|
return function() {
|
|
105
108
|
return _this.emit("job-finish-messages");
|
|
106
109
|
};
|
|
110
|
+
})(this)).tap((function(_this) {
|
|
111
|
+
return function() {
|
|
112
|
+
if (_this.earlyFinish) {
|
|
113
|
+
_this.emit("job-early-finish-messages");
|
|
114
|
+
return process.exit(0);
|
|
115
|
+
}
|
|
116
|
+
};
|
|
107
117
|
})(this))["catch"]((function(_this) {
|
|
108
118
|
return function(err) {
|
|
109
119
|
return _this.emit("job_error", {
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
|
|
31
31
|
LongTaskQueueReaderBuilder.prototype.withQueue = function(opts) {
|
|
32
32
|
var Queue;
|
|
33
|
-
this.waitingTime = opts.waitingTime, this.timeToUpdateMessage = opts.timeToUpdateMessage;
|
|
33
|
+
this.waitingTime = opts.waitingTime, this.timeToUpdateMessage = opts.timeToUpdateMessage, this.earlyFinish = opts.earlyFinish;
|
|
34
34
|
Queue = this._internalRequire("queue" + (this.poison ? ".poison" : ""));
|
|
35
35
|
this.queue = new Queue(opts);
|
|
36
36
|
this.dependencies.push(this.queue);
|
|
@@ -65,7 +65,8 @@
|
|
|
65
65
|
return new QueueProcessor(_this.queue, {
|
|
66
66
|
waitingTime: _this.waitingTime,
|
|
67
67
|
timeToUpdateMessage: _this.timeToUpdateMessage,
|
|
68
|
-
maxRetries: _this.maxRetries
|
|
68
|
+
maxRetries: _this.maxRetries,
|
|
69
|
+
earlyFinish: _this.earlyFinish
|
|
69
70
|
}, {
|
|
70
71
|
transports: _this.transports
|
|
71
72
|
}, _this._internalRequire("messageExecutor"), _this.runner, _this.poison);
|
package/package.json
CHANGED
|
@@ -1,46 +1,65 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "long-task-queue-reader",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"description": "long-task-queue-reader",
|
|
5
|
-
"main": "index.js",
|
|
6
|
-
"scripts": {
|
|
7
|
-
"test": "grunt test",
|
|
8
|
-
"
|
|
9
|
-
},
|
|
10
|
-
"repository": {
|
|
11
|
-
"type": "git",
|
|
12
|
-
"url": "git+https://github.com/Parsimotion/long-task-queue-reader.git"
|
|
13
|
-
},
|
|
14
|
-
"dependencies": {
|
|
15
|
-
"async": "~2.1.2",
|
|
16
|
-
"aws-sdk": "^2.687.0",
|
|
17
|
-
"azure-queue-node": "~1.1.0",
|
|
18
|
-
"azure-storage": "~1.3.1",
|
|
19
|
-
"bluebird": "~3.4.1",
|
|
20
|
-
"bluebird-retry": "^0.11.0",
|
|
21
|
-
"convert-units": "~1.2.0",
|
|
22
|
-
"debug": "~2.2.0",
|
|
23
|
-
"winston": "^2.4.4",
|
|
24
|
-
"winston-azure-blob-transport": "^0.3.3",
|
|
25
|
-
"winston-cloudwatch": "^1.13.1"
|
|
26
|
-
},
|
|
27
|
-
"devDependencies": {
|
|
28
|
-
"
|
|
29
|
-
"
|
|
30
|
-
"grunt
|
|
31
|
-
"grunt-
|
|
32
|
-
"grunt-contrib-
|
|
33
|
-
"grunt-
|
|
34
|
-
"
|
|
35
|
-
"
|
|
36
|
-
"
|
|
37
|
-
"
|
|
38
|
-
"
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
"
|
|
43
|
-
"
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
1
|
+
{
|
|
2
|
+
"name": "long-task-queue-reader",
|
|
3
|
+
"version": "0.8.0-beta.1",
|
|
4
|
+
"description": "long-task-queue-reader",
|
|
5
|
+
"main": "index.js",
|
|
6
|
+
"scripts": {
|
|
7
|
+
"test": "grunt test",
|
|
8
|
+
"build": "grunt build"
|
|
9
|
+
},
|
|
10
|
+
"repository": {
|
|
11
|
+
"type": "git",
|
|
12
|
+
"url": "git+https://github.com/Parsimotion/long-task-queue-reader.git"
|
|
13
|
+
},
|
|
14
|
+
"dependencies": {
|
|
15
|
+
"async": "~2.1.2",
|
|
16
|
+
"aws-sdk": "^2.687.0",
|
|
17
|
+
"azure-queue-node": "~1.1.0",
|
|
18
|
+
"azure-storage": "~1.3.1",
|
|
19
|
+
"bluebird": "~3.4.1",
|
|
20
|
+
"bluebird-retry": "^0.11.0",
|
|
21
|
+
"convert-units": "~1.2.0",
|
|
22
|
+
"debug": "~2.2.0",
|
|
23
|
+
"winston": "^2.4.4",
|
|
24
|
+
"winston-azure-blob-transport": "^0.3.3",
|
|
25
|
+
"winston-cloudwatch": "^1.13.1"
|
|
26
|
+
},
|
|
27
|
+
"devDependencies": {
|
|
28
|
+
"@producteca/linterteca": "^1.3.2",
|
|
29
|
+
"coffee-script": "~1.11.0",
|
|
30
|
+
"grunt": "~1.0.1",
|
|
31
|
+
"grunt-bump": "~0.8.0",
|
|
32
|
+
"grunt-contrib-clean": "~1.0.0",
|
|
33
|
+
"grunt-contrib-coffee": "~1.0.0",
|
|
34
|
+
"grunt-mocha-test": "~0.12.7",
|
|
35
|
+
"husky": "^3.1.0",
|
|
36
|
+
"lodash": "^4.17.11",
|
|
37
|
+
"mocha": "~3.0.2",
|
|
38
|
+
"should": "~11.1.0",
|
|
39
|
+
"should-sinon": "~0.0.5",
|
|
40
|
+
"sinon": "~1.17.6"
|
|
41
|
+
},
|
|
42
|
+
"husky": {
|
|
43
|
+
"hooks": {
|
|
44
|
+
"commit-msg": "npx linterteca-commitlint --edit $1",
|
|
45
|
+
"pre-commit": "npx lint-staged",
|
|
46
|
+
"pre-push": "npx linterteca"
|
|
47
|
+
}
|
|
48
|
+
},
|
|
49
|
+
"author": "Parsimotion",
|
|
50
|
+
"license": "MIT",
|
|
51
|
+
"bugs": {
|
|
52
|
+
"url": "https://github.com/Parsimotion/long-task-queue-reader/issues"
|
|
53
|
+
},
|
|
54
|
+
"homepage": "https://github.com/Parsimotion/long-task-queue-reader#readme",
|
|
55
|
+
"lint-staged": {
|
|
56
|
+
"*.{js,jsx}": [
|
|
57
|
+
"linterteca-lint"
|
|
58
|
+
]
|
|
59
|
+
},
|
|
60
|
+
"trustedDependencies": [
|
|
61
|
+
"aws-sdk",
|
|
62
|
+
"core-js",
|
|
63
|
+
"husky"
|
|
64
|
+
]
|
|
65
|
+
}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"folders": [
|
|
3
|
-
{
|
|
4
|
-
"follow_symlinks": true,
|
|
5
|
-
"path": ".",
|
|
6
|
-
"folder_exclude_patterns": ["compiled","public",".*", "lib", "ci", "dist", "node_modules", "client/bower_components"],
|
|
7
|
-
"file_exclude_patterns": ["asdf.*", "*.sublime-workspace"]
|
|
8
|
-
}
|
|
9
|
-
],
|
|
10
|
-
"settings": {
|
|
11
|
-
"tab_size": 2,
|
|
12
|
-
"translate_tabs_to_spaces": true
|
|
13
|
-
}
|
|
14
|
-
}
|