@tiledesk/tiledesk-server 2.4.20 → 2.4.21

Sign up to get free protection for your applications and to get access to all the features.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@tiledesk/tiledesk-server",
3
3
  "description": "The Tiledesk server module",
4
- "version": "2.4.20",
4
+ "version": "2.4.21",
5
5
  "scripts": {
6
6
  "start": "node ./bin/www",
7
7
  "pretest": "mongodb-runner start",
@@ -18,6 +18,16 @@
18
18
  var RoleConstants = require("../../models/roleConstants");
19
19
 
20
20
 
21
+ function del(client, key, callback) {
22
+ winston.debug("here1")
23
+ client.del(key).then(function(result) {
24
+ winston.debug("here2")
25
+ return callback(null, result);
26
+ }).catch(function(error) {
27
+ winston.debug("here3")
28
+ return callback(error);
29
+ });
30
+ }
21
31
 
22
32
  function listen(client) {
23
33
 
@@ -70,7 +80,9 @@
70
80
  setImmediate(() => {
71
81
  var key = "projects:id:"+project.id;
72
82
  winston.verbose("Deleting cache for project.delete with key: " + key);
73
- client.del(key, (err, reply) => {
83
+ // found del
84
+ del(client._cache, key, function (err, reply) { //tested
85
+ // client.del(key, (err, reply) => {
74
86
  winston.debug("Deleted cache for project.delete",reply);
75
87
  winston.verbose("Deleted cache for project.delete",{err:err});
76
88
  });
@@ -239,7 +251,9 @@
239
251
 
240
252
  var key = "users:id:"+user.id;
241
253
  winston.verbose("Deleting cache for user.delete with key: " + key);
242
- client.del(key, (err, reply) => {
254
+ // found del
255
+ del(client._cache, key, function (err, reply) { //tested
256
+ // client.del(key, (err, reply) => {
243
257
  winston.debug("Deleted cache for user.delete",reply);
244
258
  winston.verbose("Deleted cache for user.delete",{err:err});
245
259
  });
@@ -289,21 +303,27 @@
289
303
  function invalidatRequestSimple(client, project_id, rid, request_id) {
290
304
  var key = project_id+":requests:id:"+rid+":simple";
291
305
  winston.verbose("Deleting cache for widgets with key: " + key);
292
- client.del(key, function (err, reply) {
306
+ // found del
307
+ del(client._cache, key, function (err, reply) { //tested
308
+ // client.del(key, function (err, reply) {
293
309
  winston.debug("Deleted cache for invalidatRequestSimple",reply);
294
310
  winston.verbose("Deleted cache for invalidatRequestSimple",{err:err});
295
311
  });
296
312
 
297
313
  key = "requests:request_id:"+request_id+":simple"; //without project for chat21 webhook
298
314
  winston.verbose("Creating cache for request.create.simple for invalidatRequestSimple without project with key : " + key);
299
- client.del(key, function (err, reply) {
315
+ // found del
316
+ del(client._cache, key, function (err, reply) { //tested
317
+ // client.del(key, function (err, reply) {
300
318
  winston.debug("Deleted cache for invalidatRequestSimple",reply);
301
319
  winston.verbose("Deleted cache for invalidatRequestSimple",{err:err});
302
320
  });
303
321
 
304
322
  key = project_id+":requests:request_id:"+request_id+":simple";
305
323
  winston.verbose("Creating cache for request.create.simple for invalidatRequestSimple with key: " + key);
306
- client.del(key, function (err, reply) {
324
+ // found del
325
+ del(client._cache, key, function (err, reply) { //tested
326
+ // client.del(key, function (err, reply) {
307
327
  winston.debug("Deleted cache for invalidatRequestSimple",reply);
308
328
  winston.verbose("Deleted cache for invalidatRequestSimple",{err:err});
309
329
  });
@@ -455,7 +475,10 @@
455
475
 
456
476
  key = faq_kb.id_project+":faq_kbs:id:"+faq_kb._id+":secret";
457
477
  winston.verbose("Deleting cache for faq_kb.update secret with key: " + key);
458
- client.del(key, function (err, reply) { //tested
478
+ // found del
479
+ // winston.info("quiqui", client._cache);
480
+ del(client._cache, key, function (err, reply) { //tested
481
+ // client.del(key, function (err, reply) { //tested
459
482
  winston.debug("Deleted cache for faq_kb.update secret",reply);
460
483
  winston.verbose("Deleted cache for faq_kb.update secret",{err:err});
461
484
  });
@@ -463,7 +486,9 @@
463
486
  // without project for tilebot
464
487
  key = "faq_kbs:id:"+faq_kb._id;
465
488
  winston.verbose("Deleting cache for faq_kb.update without project for tilebot with key: " + key);
466
- client.del(key, function (err, reply) {
489
+ // found del
490
+ del(client._cache, key, function (err, reply) { //tested
491
+ // client.del(key, function (err, reply) {
467
492
  winston.debug("Deleted cache for faq_kb.update without project for tilebot ",reply);
468
493
  winston.verbose("Deleted cache for faq_kb.update without project for tilebot ",{err:err});
469
494
  });
@@ -479,7 +504,9 @@
479
504
  setImmediate(() => {
480
505
  var key = faq_kb.id_project+":faq_kbs:id:"+faq_kb._id;
481
506
  winston.verbose("Deleting cache for faqbot.delete with key: " + key);
482
- client.del(key, (err, reply) => {
507
+ // found del
508
+ del(client._cache, key, function (err, reply) { //tested
509
+ // client.del(key, (err, reply) => {
483
510
  winston.debug("Deleted cache for faqbot.delete",reply);
484
511
  winston.verbose("Deleted cache for faqbot.delete",{err:err});
485
512
  });
@@ -487,7 +514,9 @@
487
514
 
488
515
  key = faq_kb.id_project+":faq_kbs:id:"+faq_kb._id+":secret";
489
516
  winston.verbose("Deleting cache for faq_kb.delete secret with key: " + key);
490
- client.del(key, function (err, reply) {
517
+ // found del
518
+ del(client._cache, key, function (err, reply) { //tested
519
+ // client.del(key, function (err, reply) {
491
520
  winston.debug("Deleted cache for faq_kb.delete secret",reply);
492
521
  winston.verbose("Deleted cache for faq_kb.delete secret",{err:err});
493
522
  });
@@ -496,7 +525,9 @@
496
525
  // without project for tilebot
497
526
  key = "faq_kbs:id:"+faq_kb._id;
498
527
  winston.verbose("Deleting cache for faq_kb.update without project for tilebot with key: " + key);
499
- client.del(key, function (err, reply) {
528
+ // found del
529
+ del(client._cache, key, function (err, reply) { //tested
530
+ // client.del(key, function (err, reply) {
500
531
  winston.debug("Deleted cache for faq_kb.update without project for tilebot ",reply);
501
532
  winston.verbose("Deleted cache for faq_kb.update without project for tilebot ",{err:err});
502
533
  });
@@ -592,7 +623,9 @@
592
623
  setImmediate(() => {
593
624
  var key = department.id_project+":departments:id:"+department._id;
594
625
  winston.verbose("Deleting cache for department.delete with key: " + key);
595
- client.del(key, (err, reply) => {
626
+ // found del
627
+ del(client._cache, key, function (err, reply) { //tested
628
+ // client.del(key, (err, reply) => {
596
629
  winston.debug("Deleted cache for department.delete",reply);
597
630
  winston.verbose("Deleted cache for department.delete",{err:err});
598
631
  });
@@ -679,7 +712,9 @@
679
712
  // elimina delete con * e fai cancellazione puntuale
680
713
  var key =trigger.id_project+":subscriptions:*";
681
714
  winston.verbose("Deleting cache for subscription.create with key: " + key);
682
- client.del(key, function (err, reply) {
715
+ // found del
716
+ del(client._cache, key, function (err, reply) { //tested
717
+ // client.del(key, function (err, reply) {
683
718
  winston.debug("Deleted cache for subscription.create",reply);
684
719
  winston.verbose("Deleted cache for subscription.create",{err:err});
685
720
  });
@@ -691,7 +726,9 @@
691
726
  // elimina delete con * e fai cancellazione puntuale
692
727
  var key =trigger.id_project+":subscriptions:*";
693
728
  winston.verbose("Deleting cache for subscription.update with key: " + key);
694
- client.del(key, function (err, reply) {
729
+ // found del
730
+ del(client._cache, key, function (err, reply) { //tested
731
+ // client.del(key, function (err, reply) {
695
732
  winston.debug("Deleted cache for subscription.update",reply);
696
733
  winston.verbose("Deleted cache for subscription.update",{err:err});
697
734
  });
@@ -703,7 +740,9 @@
703
740
  // elimina delete con * e fai cancellazione puntuale
704
741
  var key =trigger.id_project+":subscriptions:*";
705
742
  winston.verbose("Deleting cache for subscription.delete with key: " + key);
706
- client.del(key, function (err, reply) {
743
+ // found del
744
+ del(client._cache, key, function (err, reply) { //tested
745
+ // client.del(key, function (err, reply) {
707
746
  winston.debug("Deleted cache for subscription.delete",reply);
708
747
  winston.verbose("Deleted cache for subscription.delete",{err:err});
709
748
  });
@@ -719,7 +758,9 @@
719
758
  // elimina delete con * e fai cancellazione puntuale
720
759
  var key =trigger.id_project+":triggers:*";
721
760
  winston.verbose("Deleting cache for trigger.create with key: " + key);
722
- client.del(key, function (err, reply) {
761
+ // found del
762
+ del(client._cache, key, function (err, reply) { //tested
763
+ // client.del(key, function (err, reply) {
723
764
  winston.debug("Deleted cache for trigger.create",reply);
724
765
  winston.verbose("Deleted cache for trigger.create",{err:err});
725
766
  });
@@ -731,7 +772,9 @@
731
772
  // elimina delete con * e fai cancellazione puntuale
732
773
  var key =trigger.id_project+":triggers:*";
733
774
  winston.verbose("Deleting cache for trigger.update with key: " + key);
734
- client.del(key, function (err, reply) {
775
+ // found del
776
+ del(client._cache, key, function (err, reply) { //tested
777
+ // client.del(key, function (err, reply) {
735
778
  winston.debug("Deleted cache for trigger.update",reply);
736
779
  winston.verbose("Deleted cache for trigger.update",{err:err});
737
780
  });
@@ -743,7 +786,9 @@
743
786
  // elimina delete con * e fai cancellazione puntuale
744
787
  var key =trigger.id_project+":triggers:*";
745
788
  winston.verbose("Deleting cache for trigger.delete with key: " + key);
746
- client.del(key, function (err, reply) {
789
+ // found del
790
+ del(client._cache, key, function (err, reply) { //tested
791
+ // client.del(key, function (err, reply) {
747
792
  winston.debug("Deleted cache for trigger.delete",reply);
748
793
  winston.verbose("Deleted cache for trigger.delete",{err:err});
749
794
  });
@@ -756,7 +801,9 @@
756
801
  function invalidateFaq(client, faq) {
757
802
  key = "faqs:botid:"+faq.id_faq_kb+":faq:id:*";
758
803
  winston.verbose("Deleting cache for faq with key: " + key);
759
- client.del(key, function (err, reply) {
804
+ // found del
805
+ del(client._cache, key, function (err, reply) { //tested
806
+ // client.del(key, function (err, reply) {
760
807
  winston.debug("Deleted cache for faq",reply);
761
808
  winston.verbose("Deleted cache for faq",{err:err});
762
809
  });
@@ -767,7 +814,9 @@
767
814
  function invalidateWidgets(client, project_id) {
768
815
  let key = project_id+":widgets";
769
816
  winston.verbose("Deleting cache for widgets with key: " + key);
770
- client.del(key, function (err, reply) {
817
+ // found del
818
+ del(client._cache, key, function (err, reply) { //tested
819
+ // client.del(key, function (err, reply) {
771
820
  winston.debug("Deleted cache for widgets",reply);
772
821
  winston.verbose("Deleted cache for widgets",{err:err});
773
822
  });