long-task-queue-reader 0.8.0 → 0.8.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
CHANGED
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
## [0.8.1](https://github.com/Parsimotion/long-task-queue-reader/compare/v0.8.0...v0.8.1) (2026-03-25)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* end process after getting an error ([8522d15](https://github.com/Parsimotion/long-task-queue-reader/commit/8522d15c3bf9ca5d3bb404638c1ed4f2951335db))
|
|
7
|
+
|
|
1
8
|
# [0.8.0](https://github.com/Parsimotion/long-task-queue-reader/compare/v0.7.2...v0.8.0) (2026-03-06)
|
|
2
9
|
|
|
3
10
|
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
(function() {
|
|
2
|
-
var BaseExecutionMode, _, convert;
|
|
2
|
+
var BaseExecutionMode, Promise, _, convert;
|
|
3
3
|
|
|
4
4
|
_ = require("lodash");
|
|
5
5
|
|
|
6
6
|
convert = require("convert-units");
|
|
7
7
|
|
|
8
|
+
Promise = require("bluebird");
|
|
9
|
+
|
|
8
10
|
module.exports = BaseExecutionMode = (function() {
|
|
9
11
|
function BaseExecutionMode() {}
|
|
10
12
|
|
|
@@ -45,6 +47,17 @@
|
|
|
45
47
|
}
|
|
46
48
|
};
|
|
47
49
|
|
|
50
|
+
BaseExecutionMode.prototype.handleError = function(err, reader, keepAliveMessage, message) {
|
|
51
|
+
reader.emit("job_error", {
|
|
52
|
+
method: "executionMode.execute",
|
|
53
|
+
err: err,
|
|
54
|
+
message: message
|
|
55
|
+
});
|
|
56
|
+
return Promise.resolve().tap(function() {
|
|
57
|
+
return keepAliveMessage.destroy();
|
|
58
|
+
});
|
|
59
|
+
};
|
|
60
|
+
|
|
48
61
|
return BaseExecutionMode;
|
|
49
62
|
|
|
50
63
|
})();
|
|
@@ -26,6 +26,15 @@
|
|
|
26
26
|
})(this));
|
|
27
27
|
};
|
|
28
28
|
|
|
29
|
+
OnceExecutionMode.prototype.handleError = function(err, reader, keepAliveMessage, message) {
|
|
30
|
+
return OnceExecutionMode.__super__.handleError.call(this, err, reader, keepAliveMessage, message).then((function(_this) {
|
|
31
|
+
return function() {
|
|
32
|
+
reader.emit("job-error-finish");
|
|
33
|
+
return process.exit(1);
|
|
34
|
+
};
|
|
35
|
+
})(this));
|
|
36
|
+
};
|
|
37
|
+
|
|
29
38
|
return OnceExecutionMode;
|
|
30
39
|
|
|
31
40
|
})(BaseExecutionMode);
|
|
@@ -29,6 +29,9 @@
|
|
|
29
29
|
"job-finish": function() {
|
|
30
30
|
return logger.info("Finalizo la ejecucion");
|
|
31
31
|
},
|
|
32
|
+
"job-error-finish": function() {
|
|
33
|
+
return logger.info("Finalizo la ejecucion por un error");
|
|
34
|
+
},
|
|
32
35
|
"message-start": function(message) {
|
|
33
36
|
return logger.info("Iniciando el proceso de un mensaje", message);
|
|
34
37
|
},
|
|
@@ -109,15 +112,9 @@
|
|
|
109
112
|
};
|
|
110
113
|
})(this))["catch"]((function(_this) {
|
|
111
114
|
return function(err) {
|
|
112
|
-
return _this.
|
|
113
|
-
method: "_execute",
|
|
114
|
-
err: err,
|
|
115
|
-
message: message
|
|
116
|
-
});
|
|
115
|
+
return _this.executionMode.handleError(err, _this, keepAliveMessage, message);
|
|
117
116
|
};
|
|
118
|
-
})(this)).
|
|
119
|
-
return keepAliveMessage.destroy();
|
|
120
|
-
}).then((function(_this) {
|
|
117
|
+
})(this)).then((function(_this) {
|
|
121
118
|
return function() {
|
|
122
119
|
return _this.emit("message-finish", message);
|
|
123
120
|
};
|