File tree 3 files changed +21
-4
lines changed
3 files changed +21
-4
lines changed Original file line number Diff line number Diff line change @@ -167,4 +167,18 @@ describe_only(() => {
167
167
. then ( ( ) => expect ( getQueueCount ( cache ) ) . toEqual ( 0 ) )
168
168
. then ( done ) ;
169
169
} ) ;
170
+
171
+ it ( 'should start and connect cache adapter' , async ( ) => {
172
+ const server = await reconfigureServer ( {
173
+ cacheAdapter : {
174
+ module : `${ __dirname . replace ( '/spec' , '' ) } /lib/Adapters/Cache/RedisCacheAdapter` ,
175
+ options : {
176
+ url : 'redis://127.0.0.1:6379/1' ,
177
+ } ,
178
+ } ,
179
+ } ) ;
180
+ const symbol = Object . getOwnPropertySymbols ( server . config . cacheController ) ;
181
+ const client = server . config . cacheController [ symbol [ 0 ] ] . client ;
182
+ expect ( client . isOpen ) . toBeTrue ( ) ;
183
+ } ) ;
170
184
} ) ;
Original file line number Diff line number Diff line change @@ -94,10 +94,10 @@ class ParseServer {
94
94
const {
95
95
databaseController,
96
96
hooksController,
97
+ cacheController,
97
98
cloud,
98
99
security,
99
100
schema,
100
- cacheAdapter,
101
101
liveQueryController,
102
102
} = this . config ;
103
103
try {
@@ -112,8 +112,11 @@ class ParseServer {
112
112
if ( schema ) {
113
113
startupPromises . push ( new DefinedSchemas ( schema , this . config ) . execute ( ) ) ;
114
114
}
115
- if ( cacheAdapter ?. connect && typeof cacheAdapter . connect === 'function' ) {
116
- startupPromises . push ( cacheAdapter . connect ( ) ) ;
115
+ if (
116
+ cacheController . adapter ?. connect &&
117
+ typeof cacheController . adapter . connect === 'function'
118
+ ) {
119
+ startupPromises . push ( cacheController . adapter . connect ( ) ) ;
117
120
}
118
121
startupPromises . push ( liveQueryController . connect ( ) ) ;
119
122
await Promise . all ( startupPromises ) ;
Original file line number Diff line number Diff line change @@ -13,7 +13,7 @@ export function destroyAllDataPermanently(fast) {
13
13
Object . keys ( AppCache . cache ) . map ( appId => {
14
14
const app = AppCache . get ( appId ) ;
15
15
const deletePromises = [ ] ;
16
- if ( app . cacheAdapter ) {
16
+ if ( app . cacheAdapter && app . cacheAdapter . clear ) {
17
17
deletePromises . push ( app . cacheAdapter . clear ( ) ) ;
18
18
}
19
19
if ( app . databaseController ) {
You can’t perform that action at this time.
0 commit comments