@tiledesk/tiledesk-server 2.4.21 → 2.4.22

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/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.21",
4
+ "version": "2.4.22",
5
5
  "scripts": {
6
6
  "start": "node ./bin/www",
7
7
  "pretest": "mongodb-runner start",
@@ -20,13 +20,21 @@
20
20
 
21
21
  function del(client, key, callback) {
22
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);
23
+ client.del(key, function (err, data) {
24
+ if (err) {
25
+ return callback(error);
26
+ } else {
27
+ return callback(null, data);
28
+ }
29
29
  });
30
+
31
+ // client.del(key).then(function(result) {
32
+ // winston.debug("here2")
33
+ // return callback(null, result);
34
+ // }).catch(function(error) {
35
+ // winston.debug("here3")
36
+ // return callback(error);
37
+ // });
30
38
  }
31
39
 
32
40
  function listen(client) {
@@ -81,7 +89,7 @@
81
89
  var key = "projects:id:"+project.id;
82
90
  winston.verbose("Deleting cache for project.delete with key: " + key);
83
91
  // found del
84
- del(client._cache, key, function (err, reply) { //tested
92
+ del(client._cache._engine.client, key, function (err, reply) { //tested
85
93
  // client.del(key, (err, reply) => {
86
94
  winston.debug("Deleted cache for project.delete",reply);
87
95
  winston.verbose("Deleted cache for project.delete",{err:err});
@@ -252,7 +260,7 @@
252
260
  var key = "users:id:"+user.id;
253
261
  winston.verbose("Deleting cache for user.delete with key: " + key);
254
262
  // found del
255
- del(client._cache, key, function (err, reply) { //tested
263
+ del(client._cache._engine.client, key, function (err, reply) { //tested
256
264
  // client.del(key, (err, reply) => {
257
265
  winston.debug("Deleted cache for user.delete",reply);
258
266
  winston.verbose("Deleted cache for user.delete",{err:err});
@@ -304,7 +312,7 @@
304
312
  var key = project_id+":requests:id:"+rid+":simple";
305
313
  winston.verbose("Deleting cache for widgets with key: " + key);
306
314
  // found del
307
- del(client._cache, key, function (err, reply) { //tested
315
+ del(client._cache._engine.client, key, function (err, reply) { //tested
308
316
  // client.del(key, function (err, reply) {
309
317
  winston.debug("Deleted cache for invalidatRequestSimple",reply);
310
318
  winston.verbose("Deleted cache for invalidatRequestSimple",{err:err});
@@ -313,7 +321,7 @@
313
321
  key = "requests:request_id:"+request_id+":simple"; //without project for chat21 webhook
314
322
  winston.verbose("Creating cache for request.create.simple for invalidatRequestSimple without project with key : " + key);
315
323
  // found del
316
- del(client._cache, key, function (err, reply) { //tested
324
+ del(client._cache._engine.client, key, function (err, reply) { //tested
317
325
  // client.del(key, function (err, reply) {
318
326
  winston.debug("Deleted cache for invalidatRequestSimple",reply);
319
327
  winston.verbose("Deleted cache for invalidatRequestSimple",{err:err});
@@ -322,7 +330,7 @@
322
330
  key = project_id+":requests:request_id:"+request_id+":simple";
323
331
  winston.verbose("Creating cache for request.create.simple for invalidatRequestSimple with key: " + key);
324
332
  // found del
325
- del(client._cache, key, function (err, reply) { //tested
333
+ del(client._cache._engine.client, key, function (err, reply) { //tested
326
334
  // client.del(key, function (err, reply) {
327
335
  winston.debug("Deleted cache for invalidatRequestSimple",reply);
328
336
  winston.verbose("Deleted cache for invalidatRequestSimple",{err:err});
@@ -477,7 +485,7 @@
477
485
  winston.verbose("Deleting cache for faq_kb.update secret with key: " + key);
478
486
  // found del
479
487
  // winston.info("quiqui", client._cache);
480
- del(client._cache, key, function (err, reply) { //tested
488
+ del(client._cache._engine.client, key, function (err, reply) { //tested
481
489
  // client.del(key, function (err, reply) { //tested
482
490
  winston.debug("Deleted cache for faq_kb.update secret",reply);
483
491
  winston.verbose("Deleted cache for faq_kb.update secret",{err:err});
@@ -487,7 +495,7 @@
487
495
  key = "faq_kbs:id:"+faq_kb._id;
488
496
  winston.verbose("Deleting cache for faq_kb.update without project for tilebot with key: " + key);
489
497
  // found del
490
- del(client._cache, key, function (err, reply) { //tested
498
+ del(client._cache._engine.client, key, function (err, reply) { //tested
491
499
  // client.del(key, function (err, reply) {
492
500
  winston.debug("Deleted cache for faq_kb.update without project for tilebot ",reply);
493
501
  winston.verbose("Deleted cache for faq_kb.update without project for tilebot ",{err:err});
@@ -505,7 +513,7 @@
505
513
  var key = faq_kb.id_project+":faq_kbs:id:"+faq_kb._id;
506
514
  winston.verbose("Deleting cache for faqbot.delete with key: " + key);
507
515
  // found del
508
- del(client._cache, key, function (err, reply) { //tested
516
+ del(client._cache._engine.client, key, function (err, reply) { //tested
509
517
  // client.del(key, (err, reply) => {
510
518
  winston.debug("Deleted cache for faqbot.delete",reply);
511
519
  winston.verbose("Deleted cache for faqbot.delete",{err:err});
@@ -515,7 +523,7 @@
515
523
  key = faq_kb.id_project+":faq_kbs:id:"+faq_kb._id+":secret";
516
524
  winston.verbose("Deleting cache for faq_kb.delete secret with key: " + key);
517
525
  // found del
518
- del(client._cache, key, function (err, reply) { //tested
526
+ del(client._cache._engine.client, key, function (err, reply) { //tested
519
527
  // client.del(key, function (err, reply) {
520
528
  winston.debug("Deleted cache for faq_kb.delete secret",reply);
521
529
  winston.verbose("Deleted cache for faq_kb.delete secret",{err:err});
@@ -526,7 +534,7 @@
526
534
  key = "faq_kbs:id:"+faq_kb._id;
527
535
  winston.verbose("Deleting cache for faq_kb.update without project for tilebot with key: " + key);
528
536
  // found del
529
- del(client._cache, key, function (err, reply) { //tested
537
+ del(client._cache._engine.client, key, function (err, reply) { //tested
530
538
  // client.del(key, function (err, reply) {
531
539
  winston.debug("Deleted cache for faq_kb.update without project for tilebot ",reply);
532
540
  winston.verbose("Deleted cache for faq_kb.update without project for tilebot ",{err:err});
@@ -624,7 +632,7 @@
624
632
  var key = department.id_project+":departments:id:"+department._id;
625
633
  winston.verbose("Deleting cache for department.delete with key: " + key);
626
634
  // found del
627
- del(client._cache, key, function (err, reply) { //tested
635
+ del(client._cache._engine.client, key, function (err, reply) { //tested
628
636
  // client.del(key, (err, reply) => {
629
637
  winston.debug("Deleted cache for department.delete",reply);
630
638
  winston.verbose("Deleted cache for department.delete",{err:err});
@@ -713,7 +721,7 @@
713
721
  var key =trigger.id_project+":subscriptions:*";
714
722
  winston.verbose("Deleting cache for subscription.create with key: " + key);
715
723
  // found del
716
- del(client._cache, key, function (err, reply) { //tested
724
+ del(client._cache._engine.client, key, function (err, reply) { //tested
717
725
  // client.del(key, function (err, reply) {
718
726
  winston.debug("Deleted cache for subscription.create",reply);
719
727
  winston.verbose("Deleted cache for subscription.create",{err:err});
@@ -727,7 +735,7 @@
727
735
  var key =trigger.id_project+":subscriptions:*";
728
736
  winston.verbose("Deleting cache for subscription.update with key: " + key);
729
737
  // found del
730
- del(client._cache, key, function (err, reply) { //tested
738
+ del(client._cache._engine.client, key, function (err, reply) { //tested
731
739
  // client.del(key, function (err, reply) {
732
740
  winston.debug("Deleted cache for subscription.update",reply);
733
741
  winston.verbose("Deleted cache for subscription.update",{err:err});
@@ -741,7 +749,7 @@
741
749
  var key =trigger.id_project+":subscriptions:*";
742
750
  winston.verbose("Deleting cache for subscription.delete with key: " + key);
743
751
  // found del
744
- del(client._cache, key, function (err, reply) { //tested
752
+ del(client._cache._engine.client, key, function (err, reply) { //tested
745
753
  // client.del(key, function (err, reply) {
746
754
  winston.debug("Deleted cache for subscription.delete",reply);
747
755
  winston.verbose("Deleted cache for subscription.delete",{err:err});
@@ -759,7 +767,7 @@
759
767
  var key =trigger.id_project+":triggers:*";
760
768
  winston.verbose("Deleting cache for trigger.create with key: " + key);
761
769
  // found del
762
- del(client._cache, key, function (err, reply) { //tested
770
+ del(client._cache._engine.client, key, function (err, reply) { //tested
763
771
  // client.del(key, function (err, reply) {
764
772
  winston.debug("Deleted cache for trigger.create",reply);
765
773
  winston.verbose("Deleted cache for trigger.create",{err:err});
@@ -773,7 +781,7 @@
773
781
  var key =trigger.id_project+":triggers:*";
774
782
  winston.verbose("Deleting cache for trigger.update with key: " + key);
775
783
  // found del
776
- del(client._cache, key, function (err, reply) { //tested
784
+ del(client._cache._engine.client, key, function (err, reply) { //tested
777
785
  // client.del(key, function (err, reply) {
778
786
  winston.debug("Deleted cache for trigger.update",reply);
779
787
  winston.verbose("Deleted cache for trigger.update",{err:err});
@@ -787,7 +795,7 @@
787
795
  var key =trigger.id_project+":triggers:*";
788
796
  winston.verbose("Deleting cache for trigger.delete with key: " + key);
789
797
  // found del
790
- del(client._cache, key, function (err, reply) { //tested
798
+ del(client._cache._engine.client, key, function (err, reply) { //tested
791
799
  // client.del(key, function (err, reply) {
792
800
  winston.debug("Deleted cache for trigger.delete",reply);
793
801
  winston.verbose("Deleted cache for trigger.delete",{err:err});
@@ -802,7 +810,7 @@
802
810
  key = "faqs:botid:"+faq.id_faq_kb+":faq:id:*";
803
811
  winston.verbose("Deleting cache for faq with key: " + key);
804
812
  // found del
805
- del(client._cache, key, function (err, reply) { //tested
813
+ del(client._cache._engine.client, key, function (err, reply) { //tested
806
814
  // client.del(key, function (err, reply) {
807
815
  winston.debug("Deleted cache for faq",reply);
808
816
  winston.verbose("Deleted cache for faq",{err:err});
@@ -815,7 +823,7 @@
815
823
  let key = project_id+":widgets";
816
824
  winston.verbose("Deleting cache for widgets with key: " + key);
817
825
  // found del
818
- del(client._cache, key, function (err, reply) { //tested
826
+ del(client._cache._engine.client, key, function (err, reply) { //tested
819
827
  // client.del(key, function (err, reply) {
820
828
  winston.debug("Deleted cache for widgets",reply);
821
829
  winston.verbose("Deleted cache for widgets",{err:err});
@@ -863,6 +871,9 @@ module.exports = function (mongoose, option) {
863
871
  });
864
872
 
865
873
  var client = cachegoose._cache;
874
+ // winston.info("client client", client);
875
+ // winston.info("client _cache._engine", client._cache._engine);
876
+ // winston.info("client _cache._engine.client", client._cache._engine.client);
866
877
  listen(client);
867
878
 
868
879
  return cachegoose;