File tree 3 files changed +28
-0
lines changed
test/fixtures/apps/ts-multi/redisapp-ts/app/controller
3 files changed +28
-0
lines changed Original file line number Diff line number Diff line change @@ -233,6 +233,26 @@ module.exports = app => {
233
233
};
234
234
```
235
235
236
+ ## For the local dev
237
+
238
+ Run docker compose to start test redis service
239
+
240
+ ``` bash
241
+ docker compose -f docker-compose.yml up -d
242
+ ```
243
+
244
+ Run the unit tests
245
+
246
+ ``` bash
247
+ npm test
248
+ ```
249
+
250
+ Stop test redis service
251
+
252
+ ``` bash
253
+ docker compose -f docker-compose.yml down
254
+ ```
255
+
236
256
## Questions & Suggestions
237
257
238
258
Please open an issue [ here] ( https://github.com/eggjs/egg/issues ) .
Original file line number Diff line number Diff line change
1
+ name : eggjs_redis_dev
2
+
3
+ services :
4
+ redis :
5
+ image : redis:alpine
6
+ ports :
7
+ - 6379:6379
Original file line number Diff line number Diff line change @@ -14,6 +14,7 @@ declare module 'egg' {
14
14
export default class HomeController extends Controller {
15
15
async index ( ) {
16
16
const { ctx, app } = this ;
17
+ // @deprecated please use `getSingletonInstance(id)` instead
17
18
const redis = app . redis . get ( 'cache' ) as unknown as Redis ;
18
19
await redis . set ( 'foo' , 'bar' ) ;
19
20
const redis2 = app . redis . getSingletonInstance ( 'cache' ) ;
You can’t perform that action at this time.
0 commit comments