Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: use redis client before it's ready, most likely to occur during …
…unit test (#2102) Co-authored-by: yaodong <wangyaodong@baoxiaohe.com>
- Loading branch information
1 parent
cae3c8b
commit 3f4f0cd
Showing
5 changed files
with
45 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 6 additions & 0 deletions
6
packages/redis/test/fixtures/base-app-bad-client/package.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"name": "base-app", | ||
"version": "1.0.0", | ||
"dependencies": { | ||
} | ||
} |
10 changes: 10 additions & 0 deletions
10
packages/redis/test/fixtures/base-app-bad-client/src/config.default.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
export const redis = { | ||
client: { | ||
host: '128.0.0.2', | ||
port: 6379, | ||
password: '', | ||
db: '0', | ||
connectTimeout: 2e3, | ||
retryStrategy: () => null | ||
}, | ||
}; |
14 changes: 14 additions & 0 deletions
14
packages/redis/test/fixtures/base-app-bad-client/src/configuration.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import { Configuration } from '@midwayjs/decorator'; | ||
import { join } from 'path'; | ||
|
||
@Configuration({ | ||
imports: [ | ||
require('../../../../src') | ||
], | ||
importConfigs: [ | ||
join(__dirname, './config.default'), | ||
] | ||
}) | ||
export class AutoConfiguration { | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters