keuss 1.6.4 → 1.6.8
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/.nyc_output/ad035de4-a3d3-451b-b2ad-402e8ed517b8.json +1 -0
- package/.nyc_output/{06313f3e-1553-402b-bdc2-3a7a639cd559.json → c8683d6c-e7e6-496b-ab0d-1ff730837d08.json} +0 -0
- package/.nyc_output/processinfo/ad035de4-a3d3-451b-b2ad-402e8ed517b8.json +1 -0
- package/.nyc_output/processinfo/c8683d6c-e7e6-496b-ab0d-1ff730837d08.json +1 -0
- package/.nyc_output/processinfo/index.json +1 -1
- package/Pipeline/Queue.js +24 -1
- package/Queue.js +26 -10
- package/TODO +0 -7
- package/backends/bucket-mongo-safe.js +39 -3
- package/backends/mongo.js +23 -2
- package/backends/pl-mongo.js +2 -1
- package/backends/ps-mongo.js +31 -2
- package/backends/redis-oq.js +12 -1
- package/coverage/index.html +43 -43
- package/coverage/keuss/Pipeline/BaseLink.js.html +18 -18
- package/coverage/keuss/Pipeline/Builder.js.html +1 -1
- package/coverage/keuss/Pipeline/ChoiceLink.js.html +1 -1
- package/coverage/keuss/Pipeline/DirectLink.js.html +1 -1
- package/coverage/keuss/Pipeline/Pipeline.js.html +15 -15
- package/coverage/keuss/Pipeline/Queue.js.html +124 -55
- package/coverage/keuss/Pipeline/Sink.js.html +1 -1
- package/coverage/keuss/Pipeline/index.html +18 -18
- package/coverage/keuss/QFactory-MongoDB-defaults.js.html +6 -6
- package/coverage/keuss/QFactory.js.html +28 -28
- package/coverage/keuss/Queue.js.html +232 -181
- package/coverage/keuss/Signal.js.html +28 -28
- package/coverage/keuss/Stats.js.html +4 -4
- package/coverage/keuss/backends/bucket-mongo-safe.js.html +476 -314
- package/coverage/keuss/backends/bucket-mongo.js.html +134 -86
- package/coverage/keuss/backends/index.html +69 -69
- package/coverage/keuss/backends/mongo.js.html +137 -74
- package/coverage/keuss/backends/pl-mongo.js.html +54 -54
- package/coverage/keuss/backends/ps-mongo.js.html +164 -80
- package/coverage/keuss/backends/redis-list.js.html +39 -36
- package/coverage/keuss/backends/redis-oq.js.html +27 -27
- package/coverage/keuss/index.html +18 -18
- package/coverage/keuss/signal/index.html +1 -1
- package/coverage/keuss/signal/local.js.html +17 -17
- package/coverage/keuss/signal/mongo-capped.js.html +1 -1
- package/coverage/keuss/signal/redis-pubsub.js.html +12 -12
- package/coverage/keuss/stats/index.html +10 -10
- package/coverage/keuss/stats/mem.js.html +36 -30
- package/coverage/keuss/stats/mongo.js.html +8 -8
- package/coverage/keuss/stats/redis.js.html +17 -17
- package/coverage/keuss/utils/RedisConn.js.html +1 -1
- package/coverage/keuss/utils/RedisOrderedQueue.js.html +36 -33
- package/coverage/keuss/utils/index.html +5 -5
- package/docusaurus/docs/api/queue.md +24 -1
- package/docusaurus/docs/changelog.md +11 -0
- package/docusaurus/docs/concepts.md +13 -9
- package/docusaurus/package-lock.json +4422 -10244
- package/docusaurus/package.json +6 -6
- package/docusaurus/yarn.lock +8864 -0
- package/package.json +11 -11
- package/stats/mem.js +3 -1
- package/test/backends_bucket-at-least-once.js +13 -13
- package/test/backends_remove.js +299 -0
- package/test/backends_reserve-commit-rollback.js +165 -151
- package/utils/RedisOrderedQueue.js +46 -3
- package/.nyc_output/a06aa990-295d-4428-872d-ba9fa06afd1f.json +0 -1
- package/.nyc_output/processinfo/06313f3e-1553-402b-bdc2-3a7a639cd559.json +0 -1
- package/.nyc_output/processinfo/a06aa990-295d-4428-872d-ba9fa06afd1f.json +0 -1
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"uuid":"ad035de4-a3d3-451b-b2ad-402e8ed517b8","parent":"c8683d6c-e7e6-496b-ab0d-1ff730837d08","pid":10551,"argv":["/usr/bin/node","/usr/lib/node_modules/mocha/bin/_mocha","--reporter","spec","--check-leaks","--no-timeouts","--exit","test/"],"execArgv":[],"cwd":"/home/pepe/git/keuss","time":1638528777118,"ppid":10544,"root":"937b2bb5-e1fd-4634-bd35-c917e6c21177","coverageFilename":"/home/pepe/git/keuss/.nyc_output/ad035de4-a3d3-451b-b2ad-402e8ed517b8.json","files":["/home/pepe/git/keuss/signal/local.js","/home/pepe/git/keuss/Signal.js","/home/pepe/git/keuss/stats/mem.js","/home/pepe/git/keuss/Stats.js","/home/pepe/git/keuss/backends/bucket-mongo-safe.js","/home/pepe/git/keuss/Queue.js","/home/pepe/git/keuss/QFactory-MongoDB-defaults.js","/home/pepe/git/keuss/QFactory.js","/home/pepe/git/keuss/signal/mongo-capped.js","/home/pepe/git/keuss/stats/mongo.js","/home/pepe/git/keuss/backends/bucket-mongo.js","/home/pepe/git/keuss/backends/mongo.js","/home/pepe/git/keuss/backends/pl-mongo.js","/home/pepe/git/keuss/Pipeline/Builder.js","/home/pepe/git/keuss/Pipeline/DirectLink.js","/home/pepe/git/keuss/Pipeline/BaseLink.js","/home/pepe/git/keuss/Pipeline/ChoiceLink.js","/home/pepe/git/keuss/Pipeline/Sink.js","/home/pepe/git/keuss/Pipeline/Pipeline.js","/home/pepe/git/keuss/Pipeline/Queue.js","/home/pepe/git/keuss/backends/ps-mongo.js","/home/pepe/git/keuss/backends/redis-oq.js","/home/pepe/git/keuss/utils/RedisConn.js","/home/pepe/git/keuss/utils/RedisOrderedQueue.js","/home/pepe/git/keuss/backends/redis-list.js","/home/pepe/git/keuss/stats/redis.js","/home/pepe/git/keuss/signal/redis-pubsub.js"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"uuid":"c8683d6c-e7e6-496b-ab0d-1ff730837d08","parent":null,"pid":10544,"argv":["/usr/bin/node","/usr/bin/mocha","--reporter","spec","--check-leaks","--no-timeouts","--exit","test/"],"execArgv":[],"cwd":"/home/pepe/git/keuss","time":1638528776855,"ppid":10537,"root":"937b2bb5-e1fd-4634-bd35-c917e6c21177","coverageFilename":"/home/pepe/git/keuss/.nyc_output/c8683d6c-e7e6-496b-ab0d-1ff730837d08.json","files":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"processes":{"
|
|
1
|
+
{"processes":{"ad035de4-a3d3-451b-b2ad-402e8ed517b8":{"parent":"c8683d6c-e7e6-496b-ab0d-1ff730837d08","children":[]},"c8683d6c-e7e6-496b-ab0d-1ff730837d08":{"parent":null,"children":["ad035de4-a3d3-451b-b2ad-402e8ed517b8"]}},"files":{"/home/pepe/git/keuss/signal/local.js":["ad035de4-a3d3-451b-b2ad-402e8ed517b8"],"/home/pepe/git/keuss/Signal.js":["ad035de4-a3d3-451b-b2ad-402e8ed517b8"],"/home/pepe/git/keuss/stats/mem.js":["ad035de4-a3d3-451b-b2ad-402e8ed517b8"],"/home/pepe/git/keuss/Stats.js":["ad035de4-a3d3-451b-b2ad-402e8ed517b8"],"/home/pepe/git/keuss/backends/bucket-mongo-safe.js":["ad035de4-a3d3-451b-b2ad-402e8ed517b8"],"/home/pepe/git/keuss/Queue.js":["ad035de4-a3d3-451b-b2ad-402e8ed517b8"],"/home/pepe/git/keuss/QFactory-MongoDB-defaults.js":["ad035de4-a3d3-451b-b2ad-402e8ed517b8"],"/home/pepe/git/keuss/QFactory.js":["ad035de4-a3d3-451b-b2ad-402e8ed517b8"],"/home/pepe/git/keuss/signal/mongo-capped.js":["ad035de4-a3d3-451b-b2ad-402e8ed517b8"],"/home/pepe/git/keuss/stats/mongo.js":["ad035de4-a3d3-451b-b2ad-402e8ed517b8"],"/home/pepe/git/keuss/backends/bucket-mongo.js":["ad035de4-a3d3-451b-b2ad-402e8ed517b8"],"/home/pepe/git/keuss/backends/mongo.js":["ad035de4-a3d3-451b-b2ad-402e8ed517b8"],"/home/pepe/git/keuss/backends/pl-mongo.js":["ad035de4-a3d3-451b-b2ad-402e8ed517b8"],"/home/pepe/git/keuss/Pipeline/Builder.js":["ad035de4-a3d3-451b-b2ad-402e8ed517b8"],"/home/pepe/git/keuss/Pipeline/DirectLink.js":["ad035de4-a3d3-451b-b2ad-402e8ed517b8"],"/home/pepe/git/keuss/Pipeline/BaseLink.js":["ad035de4-a3d3-451b-b2ad-402e8ed517b8"],"/home/pepe/git/keuss/Pipeline/ChoiceLink.js":["ad035de4-a3d3-451b-b2ad-402e8ed517b8"],"/home/pepe/git/keuss/Pipeline/Sink.js":["ad035de4-a3d3-451b-b2ad-402e8ed517b8"],"/home/pepe/git/keuss/Pipeline/Pipeline.js":["ad035de4-a3d3-451b-b2ad-402e8ed517b8"],"/home/pepe/git/keuss/Pipeline/Queue.js":["ad035de4-a3d3-451b-b2ad-402e8ed517b8"],"/home/pepe/git/keuss/backends/ps-mongo.js":["ad035de4-a3d3-451b-b2ad-402e8ed517b8"],"/home/pepe/git/keuss/backends/redis-oq.js":["ad035de4-a3d3-451b-b2ad-402e8ed517b8"],"/home/pepe/git/keuss/utils/RedisConn.js":["ad035de4-a3d3-451b-b2ad-402e8ed517b8"],"/home/pepe/git/keuss/utils/RedisOrderedQueue.js":["ad035de4-a3d3-451b-b2ad-402e8ed517b8"],"/home/pepe/git/keuss/backends/redis-list.js":["ad035de4-a3d3-451b-b2ad-402e8ed517b8"],"/home/pepe/git/keuss/stats/redis.js":["ad035de4-a3d3-451b-b2ad-402e8ed517b8"],"/home/pepe/git/keuss/signal/redis-pubsub.js":["ad035de4-a3d3-451b-b2ad-402e8ed517b8"]},"externalIds":{}}
|
package/Pipeline/Queue.js
CHANGED
|
@@ -73,7 +73,7 @@ class PipelinedMongoQueue extends Queue {
|
|
|
73
73
|
|
|
74
74
|
var opts = {
|
|
75
75
|
sort: {mature : 1},
|
|
76
|
-
|
|
76
|
+
returnDocument: 'before'
|
|
77
77
|
};
|
|
78
78
|
|
|
79
79
|
this._col.findOneAndUpdate (query, update, opts, (err, result) => {
|
|
@@ -234,6 +234,29 @@ class PipelinedMongoQueue extends Queue {
|
|
|
234
234
|
}
|
|
235
235
|
|
|
236
236
|
|
|
237
|
+
//////////////////////////////////////////////
|
|
238
|
+
// remove by id
|
|
239
|
+
remove (id, callback) {
|
|
240
|
+
var query;
|
|
241
|
+
|
|
242
|
+
try {
|
|
243
|
+
query = {
|
|
244
|
+
_id: (_.isString(id) ? new mongo.ObjectID (id) : id),
|
|
245
|
+
_q: this._name,
|
|
246
|
+
reserved: {$exists: false}
|
|
247
|
+
};
|
|
248
|
+
}
|
|
249
|
+
catch (e) {
|
|
250
|
+
return callback ('id [' + id + '] can not be used as remove id: ' + e);
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
this._col.deleteOne (query, {}, (err, result) => {
|
|
254
|
+
if (err) return callback (err);
|
|
255
|
+
callback (null, result && (result.deletedCount == 1));
|
|
256
|
+
});
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
|
|
237
260
|
//////////////////////////////////////////////
|
|
238
261
|
_embed_update_for_payload (dst, src) {
|
|
239
262
|
_.each (src, (v, k) => {
|
package/Queue.js
CHANGED
|
@@ -42,6 +42,12 @@ class Queue {
|
|
|
42
42
|
this._stats.incr ('get', 0);
|
|
43
43
|
this._stats.incr ('put', 0);
|
|
44
44
|
|
|
45
|
+
if (factory.capabilities().reserve) {
|
|
46
|
+
this._stats.incr ('reserve', 0);
|
|
47
|
+
this._stats.incr ('commit', 0);
|
|
48
|
+
this._stats.incr ('rollback', 0);
|
|
49
|
+
}
|
|
50
|
+
|
|
45
51
|
// if true, queue is being drained just before shutdown
|
|
46
52
|
this._in_drain = false;
|
|
47
53
|
|
|
@@ -88,6 +94,9 @@ class Queue {
|
|
|
88
94
|
// Date of next
|
|
89
95
|
next_t (callback) {callback (null, null);}
|
|
90
96
|
|
|
97
|
+
// remove (and return if possible) by id
|
|
98
|
+
remove (id, callback) {callback(null, null);}
|
|
99
|
+
|
|
91
100
|
// end of expected redefinitions on subclasses
|
|
92
101
|
////////////////////////////////////////////////////////////////////////////
|
|
93
102
|
|
|
@@ -396,12 +405,18 @@ class Queue {
|
|
|
396
405
|
// high level commit
|
|
397
406
|
ok (obj, cb) {
|
|
398
407
|
// allow commit with either _id of full object
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
408
|
+
const id = (obj._id ? obj._id : obj);
|
|
409
|
+
this.commit (id, (err, res) => {
|
|
410
|
+
if (!err){
|
|
411
|
+
debug ('%s: ok : committed ok tid %s', this._name, id);
|
|
412
|
+
this._stats.incr ('commit');
|
|
413
|
+
}
|
|
414
|
+
else {
|
|
415
|
+
debug ('%s: ok : error when committing tid %s: %o', this._name, id, err);
|
|
416
|
+
}
|
|
417
|
+
|
|
418
|
+
cb (err, res);
|
|
419
|
+
});
|
|
405
420
|
}
|
|
406
421
|
|
|
407
422
|
|
|
@@ -436,6 +451,7 @@ class Queue {
|
|
|
436
451
|
if (res) {
|
|
437
452
|
var t = new Date (next_t || null);
|
|
438
453
|
debug ('%s: ko : tid %s rolled back, new mature is %s', this._name, id, t);
|
|
454
|
+
if (!err) this._stats.incr ('rollback');
|
|
439
455
|
this._signal_insertion (t);
|
|
440
456
|
}
|
|
441
457
|
|
|
@@ -593,9 +609,9 @@ class Queue {
|
|
|
593
609
|
|
|
594
610
|
// got an element
|
|
595
611
|
this._next_mature_t = null;
|
|
596
|
-
this._stats.incr ('get');
|
|
612
|
+
this._stats.incr (consumer.reserve ? 'reserve': 'get');
|
|
597
613
|
|
|
598
|
-
debug ('%s - tid %s: getOrReserve_cb : got result %j', this._name, consumer.tid, result);
|
|
614
|
+
debug ('%s - tid %s: getOrReserve_cb : got result (%s) %j', this._name, consumer.tid, (consumer.reserve ? 'reserve': 'get'), result);
|
|
599
615
|
|
|
600
616
|
// clean timeout timer
|
|
601
617
|
if (consumer.cleanup_timeout) {
|
|
@@ -704,11 +720,11 @@ class Queue {
|
|
|
704
720
|
this._factory.deadletter_queue ().push (obj.payload, (err, res) => {
|
|
705
721
|
if (err) {
|
|
706
722
|
debug ('while moving %s to deadletter: %j', obj._id, err);
|
|
707
|
-
return cb (err);
|
|
723
|
+
return cb (err, 'deadletter');
|
|
708
724
|
}
|
|
709
725
|
else {
|
|
710
726
|
debug ('moved %s to deadletter with _id %s', obj._id, res);
|
|
711
|
-
return cb (null,
|
|
727
|
+
return cb (null, 'deadletter');
|
|
712
728
|
}
|
|
713
729
|
});
|
|
714
730
|
});
|
package/TODO
CHANGED
|
@@ -1,13 +1,6 @@
|
|
|
1
1
|
bugs
|
|
2
2
|
-------------------------------------------------------------
|
|
3
3
|
|
|
4
|
-
|
|
5
|
-
prio 2
|
|
6
|
-
-------------------------------------------------------------
|
|
7
|
-
* add headers as sibling to payload
|
|
8
|
-
* remove elements from queue by id
|
|
9
|
-
|
|
10
|
-
|
|
11
4
|
prio 1
|
|
12
5
|
-------------------------------------------------------------
|
|
13
6
|
* queue traversal/query
|
|
@@ -293,7 +293,7 @@ class BucketSet {
|
|
|
293
293
|
|
|
294
294
|
var opts = {
|
|
295
295
|
sort: {mature : 1},
|
|
296
|
-
|
|
296
|
+
returnDocument: 'after'
|
|
297
297
|
};
|
|
298
298
|
|
|
299
299
|
debug ('reading a new bucket');
|
|
@@ -581,7 +581,7 @@ class BucketMongoSafeQueue extends Queue {
|
|
|
581
581
|
__h: (entry.hdrs || {})
|
|
582
582
|
});
|
|
583
583
|
|
|
584
|
-
var id = this._insert_bucket._id.toString () + ':' + this._insert_bucket.b.length;
|
|
584
|
+
var id = this._insert_bucket._id.toString () + ':' + (this._insert_bucket.b.length - 1);
|
|
585
585
|
debug ('added to bucket, %s', id);
|
|
586
586
|
|
|
587
587
|
if (this._insert_bucket.b.length >= this._bucket_max_size) {
|
|
@@ -738,6 +738,41 @@ class BucketMongoSafeQueue extends Queue {
|
|
|
738
738
|
}
|
|
739
739
|
|
|
740
740
|
|
|
741
|
+
|
|
742
|
+
//////////////////////////////////////////////
|
|
743
|
+
// remove by id
|
|
744
|
+
remove (id, callback) {
|
|
745
|
+
try {
|
|
746
|
+
var aid = id.split (':');
|
|
747
|
+
var bucket_id = new mongo.ObjectID (aid[0]);
|
|
748
|
+
var bucket_idx = parseInt(aid[1]);
|
|
749
|
+
}
|
|
750
|
+
catch (e) {
|
|
751
|
+
return callback ('id [' + id + '] can not be used as remove id: ' + e);
|
|
752
|
+
}
|
|
753
|
+
|
|
754
|
+
var upd = {
|
|
755
|
+
$set: {},
|
|
756
|
+
$inc: {n: -1}
|
|
757
|
+
};
|
|
758
|
+
|
|
759
|
+
upd.$set['b.' + bucket_idx] = null;
|
|
760
|
+
|
|
761
|
+
var q = {
|
|
762
|
+
_id: bucket_id,
|
|
763
|
+
reserved: {$exists: false},
|
|
764
|
+
};
|
|
765
|
+
|
|
766
|
+
q['b.' + bucket_idx] = {$type: 3}; // b.N is an object
|
|
767
|
+
|
|
768
|
+
debug ('update on bucket: q is %o, upd is %o', q, upd);
|
|
769
|
+
this._col.updateOne (q, upd, (err, result) => {
|
|
770
|
+
if (err) return callback (err);
|
|
771
|
+
callback (null, result && (result.modifiedCount == 1));
|
|
772
|
+
});
|
|
773
|
+
}
|
|
774
|
+
|
|
775
|
+
|
|
741
776
|
/////////////////////////////////////////
|
|
742
777
|
_drain_read (cb) {
|
|
743
778
|
debug ('drain_read called');
|
|
@@ -907,7 +942,8 @@ class Factory extends QFactory_MongoDB_defaults {
|
|
|
907
942
|
return {
|
|
908
943
|
sched: false,
|
|
909
944
|
reserve: true,
|
|
910
|
-
pipeline: false
|
|
945
|
+
pipeline: false,
|
|
946
|
+
remove: true
|
|
911
947
|
};
|
|
912
948
|
}
|
|
913
949
|
}
|
package/backends/mongo.js
CHANGED
|
@@ -68,7 +68,7 @@ class SimpleMongoQueue extends Queue {
|
|
|
68
68
|
|
|
69
69
|
var opts = {
|
|
70
70
|
sort: {mature : 1},
|
|
71
|
-
|
|
71
|
+
returnDocument: 'before'
|
|
72
72
|
};
|
|
73
73
|
|
|
74
74
|
this._col.findOneAndUpdate (query, update, opts, (err, result) => {
|
|
@@ -188,6 +188,26 @@ class SimpleMongoQueue extends Queue {
|
|
|
188
188
|
}
|
|
189
189
|
|
|
190
190
|
|
|
191
|
+
//////////////////////////////////////////////
|
|
192
|
+
// remove by id
|
|
193
|
+
remove (id, callback) {
|
|
194
|
+
try {
|
|
195
|
+
var query = {
|
|
196
|
+
_id: (_.isString(id) ? new mongo.ObjectID (id) : id),
|
|
197
|
+
reserved: {$exists: false}
|
|
198
|
+
};
|
|
199
|
+
}
|
|
200
|
+
catch (e) {
|
|
201
|
+
return callback ('id [' + id + '] can not be used as remove id: ' + e);
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
this._col.deleteOne (query, {}, (err, result) => {
|
|
205
|
+
if (err) return callback (err);
|
|
206
|
+
callback (null, result && (result.deletedCount == 1));
|
|
207
|
+
});
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
|
|
191
211
|
///////////////////////////////////////////////////////////////////////////////
|
|
192
212
|
// private parts
|
|
193
213
|
|
|
@@ -231,7 +251,8 @@ class Factory extends QFactory_MongoDB_defaults {
|
|
|
231
251
|
return {
|
|
232
252
|
sched: true,
|
|
233
253
|
reserve: true,
|
|
234
|
-
pipeline: false
|
|
254
|
+
pipeline: false,
|
|
255
|
+
remove: true
|
|
235
256
|
};
|
|
236
257
|
}
|
|
237
258
|
}
|
package/backends/pl-mongo.js
CHANGED
package/backends/ps-mongo.js
CHANGED
|
@@ -84,7 +84,7 @@ class PersistentMongoQueue extends Queue {
|
|
|
84
84
|
|
|
85
85
|
var opts = {
|
|
86
86
|
sort: {mature : 1},
|
|
87
|
-
|
|
87
|
+
returnDocument: 'before'
|
|
88
88
|
};
|
|
89
89
|
|
|
90
90
|
this._col.findOneAndUpdate (query, update, opts, (err, result) => {
|
|
@@ -209,6 +209,34 @@ class PersistentMongoQueue extends Queue {
|
|
|
209
209
|
}
|
|
210
210
|
|
|
211
211
|
|
|
212
|
+
//////////////////////////////////////////////
|
|
213
|
+
// remove by id
|
|
214
|
+
remove (id, callback) {
|
|
215
|
+
var query;
|
|
216
|
+
|
|
217
|
+
try {
|
|
218
|
+
query = {
|
|
219
|
+
_id: (_.isString(id) ? new mongo.ObjectID (id) : id),
|
|
220
|
+
reserved: {$exists: false}
|
|
221
|
+
};
|
|
222
|
+
}
|
|
223
|
+
catch (e) {
|
|
224
|
+
return callback ('id [' + id + '] can not be used as remove id: ' + e);
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
var updt = {
|
|
228
|
+
$set: {processed: new Date (), removed: true},
|
|
229
|
+
};
|
|
230
|
+
|
|
231
|
+
var opts = {};
|
|
232
|
+
|
|
233
|
+
this._col.updateOne (query, updt, opts, (err, result) => {
|
|
234
|
+
if (err) return callback (err);
|
|
235
|
+
callback (null, result && (result.modifiedCount == 1));
|
|
236
|
+
});
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
|
|
212
240
|
/////////////////////////////////////////
|
|
213
241
|
// get element from queue
|
|
214
242
|
next_t (callback) {
|
|
@@ -271,7 +299,8 @@ class Factory extends QFactory_MongoDB_defaults {
|
|
|
271
299
|
sched: true,
|
|
272
300
|
reserve: true,
|
|
273
301
|
pipeline: false,
|
|
274
|
-
tape: true
|
|
302
|
+
tape: true,
|
|
303
|
+
remove: true
|
|
275
304
|
};
|
|
276
305
|
}
|
|
277
306
|
}
|
package/backends/redis-oq.js
CHANGED
|
@@ -106,6 +106,16 @@ class RedisOQ extends Queue {
|
|
|
106
106
|
callback (null, new Date (parseInt (res[1])));
|
|
107
107
|
});
|
|
108
108
|
}
|
|
109
|
+
|
|
110
|
+
|
|
111
|
+
//////////////////////////////////////////////
|
|
112
|
+
// remove by id
|
|
113
|
+
remove (id, callback) {
|
|
114
|
+
this._roq.remove (id, (err, res) => {
|
|
115
|
+
if (err) return callback (err);
|
|
116
|
+
return callback (null, res != null)
|
|
117
|
+
});
|
|
118
|
+
}
|
|
109
119
|
};
|
|
110
120
|
|
|
111
121
|
|
|
@@ -139,7 +149,8 @@ class Factory extends QFactory {
|
|
|
139
149
|
return {
|
|
140
150
|
sched: true,
|
|
141
151
|
reserve: true,
|
|
142
|
-
pipeline: false
|
|
152
|
+
pipeline: false,
|
|
153
|
+
remove: true
|
|
143
154
|
};
|
|
144
155
|
}
|
|
145
156
|
}
|
package/coverage/index.html
CHANGED
|
@@ -20,24 +20,24 @@
|
|
|
20
20
|
</h1>
|
|
21
21
|
<div class='clearfix'>
|
|
22
22
|
<div class='fl pad1y space-right2'>
|
|
23
|
-
<span class="strong">
|
|
23
|
+
<span class="strong">84.32% </span>
|
|
24
24
|
<span class="quiet">Statements</span>
|
|
25
|
-
<span class='fraction'>
|
|
25
|
+
<span class='fraction'>2028/2405</span>
|
|
26
26
|
</div>
|
|
27
27
|
<div class='fl pad1y space-right2'>
|
|
28
|
-
<span class="strong">
|
|
28
|
+
<span class="strong">74.28% </span>
|
|
29
29
|
<span class="quiet">Branches</span>
|
|
30
|
-
<span class='fraction'>
|
|
30
|
+
<span class='fraction'>829/1116</span>
|
|
31
31
|
</div>
|
|
32
32
|
<div class='fl pad1y space-right2'>
|
|
33
|
-
<span class="strong">
|
|
33
|
+
<span class="strong">85.38% </span>
|
|
34
34
|
<span class="quiet">Functions</span>
|
|
35
|
-
<span class='fraction'>
|
|
35
|
+
<span class='fraction'>549/643</span>
|
|
36
36
|
</div>
|
|
37
37
|
<div class='fl pad1y space-right2'>
|
|
38
|
-
<span class="strong">
|
|
38
|
+
<span class="strong">88.55% </span>
|
|
39
39
|
<span class="quiet">Lines</span>
|
|
40
|
-
<span class='fraction'>
|
|
40
|
+
<span class='fraction'>1902/2148</span>
|
|
41
41
|
</div>
|
|
42
42
|
</div>
|
|
43
43
|
<p class="quiet">
|
|
@@ -63,41 +63,41 @@
|
|
|
63
63
|
</thead>
|
|
64
64
|
<tbody><tr>
|
|
65
65
|
<td class="file medium" data-value="keuss"><a href="keuss/index.html">keuss</a></td>
|
|
66
|
-
<td data-value="72.
|
|
67
|
-
<td data-value="72.
|
|
68
|
-
<td data-value="
|
|
69
|
-
<td data-value="73.
|
|
70
|
-
<td data-value="
|
|
71
|
-
<td data-value="56.
|
|
72
|
-
<td data-value="
|
|
73
|
-
<td data-value="74.
|
|
74
|
-
<td data-value="
|
|
66
|
+
<td data-value="72.26" class="pic medium"><div class="chart"><div class="cover-fill" style="width: 72%;"></div><div class="cover-empty" style="width:28%;"></div></div></td>
|
|
67
|
+
<td data-value="72.26" class="pct medium">72.26%</td>
|
|
68
|
+
<td data-value="447" class="abs medium">323/447</td>
|
|
69
|
+
<td data-value="73.45" class="pct medium">73.45%</td>
|
|
70
|
+
<td data-value="226" class="abs medium">166/226</td>
|
|
71
|
+
<td data-value="56.76" class="pct medium">56.76%</td>
|
|
72
|
+
<td data-value="111" class="abs medium">63/111</td>
|
|
73
|
+
<td data-value="74.22" class="pct medium">74.22%</td>
|
|
74
|
+
<td data-value="419" class="abs medium">311/419</td>
|
|
75
75
|
</tr>
|
|
76
76
|
|
|
77
77
|
<tr>
|
|
78
78
|
<td class="file high" data-value="keuss/Pipeline"><a href="keuss/Pipeline/index.html">keuss/Pipeline</a></td>
|
|
79
|
-
<td data-value="87.
|
|
80
|
-
<td data-value="87.
|
|
81
|
-
<td data-value="
|
|
82
|
-
<td data-value="74.
|
|
83
|
-
<td data-value="
|
|
84
|
-
<td data-value="96.
|
|
85
|
-
<td data-value="
|
|
86
|
-
<td data-value="94.
|
|
87
|
-
<td data-value="
|
|
79
|
+
<td data-value="87.28" class="pic high"><div class="chart"><div class="cover-fill" style="width: 87%;"></div><div class="cover-empty" style="width:13%;"></div></div></td>
|
|
80
|
+
<td data-value="87.28" class="pct high">87.28%</td>
|
|
81
|
+
<td data-value="393" class="abs high">343/393</td>
|
|
82
|
+
<td data-value="74.71" class="pct medium">74.71%</td>
|
|
83
|
+
<td data-value="170" class="abs medium">127/170</td>
|
|
84
|
+
<td data-value="96.26" class="pct high">96.26%</td>
|
|
85
|
+
<td data-value="107" class="abs high">103/107</td>
|
|
86
|
+
<td data-value="94.19" class="pct high">94.19%</td>
|
|
87
|
+
<td data-value="344" class="abs high">324/344</td>
|
|
88
88
|
</tr>
|
|
89
89
|
|
|
90
90
|
<tr>
|
|
91
91
|
<td class="file high" data-value="keuss/backends"><a href="keuss/backends/index.html">keuss/backends</a></td>
|
|
92
|
-
<td data-value="
|
|
93
|
-
<td data-value="
|
|
94
|
-
<td data-value="
|
|
95
|
-
<td data-value="
|
|
96
|
-
<td data-value="
|
|
97
|
-
<td data-value="
|
|
98
|
-
<td data-value="
|
|
99
|
-
<td data-value="
|
|
100
|
-
<td data-value="
|
|
92
|
+
<td data-value="86.35" class="pic high"><div class="chart"><div class="cover-fill" style="width: 86%;"></div><div class="cover-empty" style="width:14%;"></div></div></td>
|
|
93
|
+
<td data-value="86.35" class="pct high">86.35%</td>
|
|
94
|
+
<td data-value="1026" class="abs high">886/1026</td>
|
|
95
|
+
<td data-value="72.52" class="pct medium">72.52%</td>
|
|
96
|
+
<td data-value="473" class="abs medium">343/473</td>
|
|
97
|
+
<td data-value="91.67" class="pct high">91.67%</td>
|
|
98
|
+
<td data-value="276" class="abs high">253/276</td>
|
|
99
|
+
<td data-value="91.53" class="pct high">91.53%</td>
|
|
100
|
+
<td data-value="897" class="abs high">821/897</td>
|
|
101
101
|
</tr>
|
|
102
102
|
|
|
103
103
|
<tr>
|
|
@@ -115,15 +115,15 @@
|
|
|
115
115
|
|
|
116
116
|
<tr>
|
|
117
117
|
<td class="file high" data-value="keuss/stats"><a href="keuss/stats/index.html">keuss/stats</a></td>
|
|
118
|
-
<td data-value="88.
|
|
119
|
-
<td data-value="88.
|
|
120
|
-
<td data-value="
|
|
118
|
+
<td data-value="88.51" class="pic high"><div class="chart"><div class="cover-fill" style="width: 88%;"></div><div class="cover-empty" style="width:12%;"></div></div></td>
|
|
119
|
+
<td data-value="88.51" class="pct high">88.51%</td>
|
|
120
|
+
<td data-value="348" class="abs high">308/348</td>
|
|
121
121
|
<td data-value="79.89" class="pct medium">79.89%</td>
|
|
122
122
|
<td data-value="179" class="abs medium">143/179</td>
|
|
123
123
|
<td data-value="89.58" class="pct high">89.58%</td>
|
|
124
124
|
<td data-value="96" class="abs high">86/96</td>
|
|
125
|
-
<td data-value="92.
|
|
126
|
-
<td data-value="
|
|
125
|
+
<td data-value="92.48" class="pct high">92.48%</td>
|
|
126
|
+
<td data-value="306" class="abs high">283/306</td>
|
|
127
127
|
</tr>
|
|
128
128
|
|
|
129
129
|
<tr>
|
|
@@ -131,8 +131,8 @@
|
|
|
131
131
|
<td data-value="91.94" class="pic high"><div class="chart"><div class="cover-fill" style="width: 91%;"></div><div class="cover-empty" style="width:9%;"></div></div></td>
|
|
132
132
|
<td data-value="91.94" class="pct high">91.94%</td>
|
|
133
133
|
<td data-value="62" class="abs high">57/62</td>
|
|
134
|
-
<td data-value="
|
|
135
|
-
<td data-value="
|
|
134
|
+
<td data-value="79.41" class="pct medium">79.41%</td>
|
|
135
|
+
<td data-value="34" class="abs medium">27/34</td>
|
|
136
136
|
<td data-value="100" class="pct high">100%</td>
|
|
137
137
|
<td data-value="15" class="abs high">15/15</td>
|
|
138
138
|
<td data-value="94.74" class="pct high">94.74%</td>
|
|
@@ -145,7 +145,7 @@
|
|
|
145
145
|
</div><!-- /wrapper -->
|
|
146
146
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
147
147
|
Code coverage
|
|
148
|
-
generated by <a href="https://istanbul.js.org/" target="_blank">istanbul</a> at
|
|
148
|
+
generated by <a href="https://istanbul.js.org/" target="_blank">istanbul</a> at Fri Dec 03 2021 12:14:40 GMT+0100 (GMT+01:00)
|
|
149
149
|
</div>
|
|
150
150
|
</div>
|
|
151
151
|
<script src="prettify.js"></script>
|
|
@@ -260,7 +260,7 @@
|
|
|
260
260
|
<span class="cline-any cline-yes">42x</span>
|
|
261
261
|
<span class="cline-any cline-neutral"> </span>
|
|
262
262
|
<span class="cline-any cline-neutral"> </span>
|
|
263
|
-
<span class="cline-any cline-yes">
|
|
263
|
+
<span class="cline-any cline-yes">300x</span>
|
|
264
264
|
<span class="cline-any cline-yes">132x</span>
|
|
265
265
|
<span class="cline-any cline-neutral"> </span>
|
|
266
266
|
<span class="cline-any cline-no"> </span>
|
|
@@ -317,7 +317,7 @@
|
|
|
317
317
|
<span class="cline-any cline-neutral"> </span>
|
|
318
318
|
<span class="cline-any cline-neutral"> </span>
|
|
319
319
|
<span class="cline-any cline-neutral"> </span>
|
|
320
|
-
<span class="cline-any cline-yes">
|
|
320
|
+
<span class="cline-any cline-yes">12x</span>
|
|
321
321
|
<span class="cline-any cline-neutral"> </span>
|
|
322
322
|
<span class="cline-any cline-yes">1x</span>
|
|
323
323
|
<span class="cline-any cline-yes">1x</span>
|
|
@@ -327,10 +327,10 @@
|
|
|
327
327
|
<span class="cline-any cline-neutral"> </span>
|
|
328
328
|
<span class="cline-any cline-neutral"> </span>
|
|
329
329
|
<span class="cline-any cline-neutral"> </span>
|
|
330
|
-
<span class="cline-any cline-yes">
|
|
331
|
-
<span class="cline-any cline-yes">
|
|
332
|
-
<span class="cline-any cline-yes">
|
|
333
|
-
<span class="cline-any cline-yes">
|
|
330
|
+
<span class="cline-any cline-yes">11x</span>
|
|
331
|
+
<span class="cline-any cline-yes">11x</span>
|
|
332
|
+
<span class="cline-any cline-yes">11x</span>
|
|
333
|
+
<span class="cline-any cline-yes">11x</span>
|
|
334
334
|
<span class="cline-any cline-neutral"> </span>
|
|
335
335
|
<span class="cline-any cline-neutral"> </span>
|
|
336
336
|
<span class="cline-any cline-neutral"> </span>
|
|
@@ -338,12 +338,12 @@
|
|
|
338
338
|
<span class="cline-any cline-neutral"> </span>
|
|
339
339
|
<span class="cline-any cline-neutral"> </span>
|
|
340
340
|
<span class="cline-any cline-neutral"> </span>
|
|
341
|
-
<span class="cline-any cline-yes">
|
|
341
|
+
<span class="cline-any cline-yes">140x</span>
|
|
342
342
|
<span class="cline-any cline-neutral"> </span>
|
|
343
|
-
<span class="cline-any cline-yes">
|
|
344
|
-
<span class="cline-any cline-yes">
|
|
343
|
+
<span class="cline-any cline-yes">140x</span>
|
|
344
|
+
<span class="cline-any cline-yes">133x</span>
|
|
345
345
|
<span class="cline-any cline-neutral"> </span>
|
|
346
|
-
<span class="cline-any cline-yes">
|
|
346
|
+
<span class="cline-any cline-yes">133x</span>
|
|
347
347
|
<span class="cline-any cline-yes">35x</span>
|
|
348
348
|
<span class="cline-any cline-yes">35x</span>
|
|
349
349
|
<span class="cline-any cline-yes">35x</span>
|
|
@@ -354,17 +354,17 @@
|
|
|
354
354
|
<span class="cline-any cline-no"> </span>
|
|
355
355
|
<span class="cline-any cline-neutral"> </span>
|
|
356
356
|
<span class="cline-any cline-neutral"> </span>
|
|
357
|
-
<span class="cline-any cline-yes">
|
|
357
|
+
<span class="cline-any cline-yes">98x</span>
|
|
358
358
|
<span class="cline-any cline-no"> </span>
|
|
359
359
|
<span class="cline-any cline-no"> </span>
|
|
360
360
|
<span class="cline-any cline-neutral"> </span>
|
|
361
361
|
<span class="cline-any cline-neutral"> </span>
|
|
362
362
|
<span class="cline-any cline-neutral"> </span>
|
|
363
|
-
<span class="cline-any cline-yes">
|
|
364
|
-
<span class="cline-any cline-yes">
|
|
365
|
-
<span class="cline-any cline-yes">
|
|
363
|
+
<span class="cline-any cline-yes">98x</span>
|
|
364
|
+
<span class="cline-any cline-yes">98x</span>
|
|
365
|
+
<span class="cline-any cline-yes">98x</span>
|
|
366
366
|
<span class="cline-any cline-neutral"> </span>
|
|
367
|
-
<span class="cline-any cline-yes">
|
|
367
|
+
<span class="cline-any cline-yes">98x</span>
|
|
368
368
|
<span class="cline-any cline-neutral"> </span>
|
|
369
369
|
<span class="cline-any cline-neutral"> </span>
|
|
370
370
|
<span class="cline-any cline-yes">86x</span>
|
|
@@ -411,8 +411,8 @@
|
|
|
411
411
|
<span class="cline-any cline-neutral"> </span>
|
|
412
412
|
<span class="cline-any cline-neutral"> </span>
|
|
413
413
|
<span class="cline-any cline-neutral"> </span>
|
|
414
|
-
<span class="cline-any cline-yes">
|
|
415
|
-
<span class="cline-any cline-yes">
|
|
414
|
+
<span class="cline-any cline-yes">11x</span>
|
|
415
|
+
<span class="cline-any cline-yes">11x</span>
|
|
416
416
|
<span class="cline-any cline-neutral"> </span>
|
|
417
417
|
<span class="cline-any cline-neutral"> </span>
|
|
418
418
|
<span class="cline-any cline-neutral"> </span>
|
|
@@ -619,7 +619,7 @@ module.exports = BaseLink;
|
|
|
619
619
|
</div><!-- /wrapper -->
|
|
620
620
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
621
621
|
Code coverage
|
|
622
|
-
generated by <a href="https://istanbul.js.org/" target="_blank">istanbul</a> at
|
|
622
|
+
generated by <a href="https://istanbul.js.org/" target="_blank">istanbul</a> at Fri Dec 03 2021 12:14:40 GMT+0100 (GMT+01:00)
|
|
623
623
|
</div>
|
|
624
624
|
</div>
|
|
625
625
|
<script src="../../prettify.js"></script>
|
|
@@ -598,7 +598,7 @@ module.exports = PipelineBuilder;
|
|
|
598
598
|
</div><!-- /wrapper -->
|
|
599
599
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
600
600
|
Code coverage
|
|
601
|
-
generated by <a href="https://istanbul.js.org/" target="_blank">istanbul</a> at
|
|
601
|
+
generated by <a href="https://istanbul.js.org/" target="_blank">istanbul</a> at Fri Dec 03 2021 12:14:40 GMT+0100 (GMT+01:00)
|
|
602
602
|
</div>
|
|
603
603
|
</div>
|
|
604
604
|
<script src="../../prettify.js"></script>
|