File tree Expand file tree Collapse file tree 1 file changed +36
-6
lines changed Expand file tree Collapse file tree 1 file changed +36
-6
lines changed Original file line number Diff line number Diff line change @@ -6,16 +6,46 @@ class CacheManagerClass {
66 this . _cache = new NodeCache ( opts ) ;
77 }
88 get ( key ) {
9- return this . _cache . get ( key ) ;
9+ try {
10+ return this . _cache . get ( key ) ;
11+ } catch ( error ) {
12+ ErrorManager . error ( error )
13+ }
1014 }
1115 set ( key , obj , timeout ) {
12- const res = this . _cache . set ( key , obj , timeout ) ;
13- if ( res === false ) {
14- ErrorManager . Error ( "Cache not behaving correctly. Didn't set value" ) ;
15- } else {
16- return true ;
16+ try {
17+ const res = this . _cache . set ( key , obj , timeout ) ;
18+ if ( res === false ) {
19+ ErrorManager . Error ( "Cache not behaving correctly. Didn't set value" ) ;
20+ } else {
21+ return true ;
22+ }
23+ } catch ( error ) {
24+ ErrorManager . Error ( error ) ;
25+ }
26+ }
27+ take ( key ) {
28+ try {
29+ return this . _cache . take ( key ) ;
30+ } catch ( error ) {
31+ ErrorManager . Error ( error )
32+ }
33+ }
34+ del ( key ) {
35+ try {
36+ return this . _cache . del ( key ) ;
37+ } catch ( error ) {
38+ ErrorManager . Error ( error )
39+ }
40+ }
41+ has ( key ) {
42+ try {
43+ return this . _cache . has ( key )
44+ } catch ( error ) {
45+ ErrorManager . Error ( error )
1746 }
1847 }
48+
1949}
2050let CacheManager = new CacheManagerClass ( {
2151 checkperiod : 120 ,
You can’t perform that action at this time.
0 commit comments