create-aomex 0.0.58 → 0.0.60
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
package/templates/src/cli.ts
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
|
+
import { Caching } from '@aomex/cache';
|
|
2
|
+
import { redisAdapter } from '@aomex/cache-redis-adapter';
|
|
1
3
|
import { commanders, ConsoleApp } from '@aomex/console';
|
|
2
4
|
import { crons } from '@aomex/cron';
|
|
3
|
-
import { redisCache } from '@services/cache.service';
|
|
4
5
|
import { openapi } from '@aomex/openapi';
|
|
6
|
+
import { configs } from '@configs';
|
|
5
7
|
import { logger } from '@services/logger';
|
|
6
8
|
|
|
7
9
|
const app = new ConsoleApp({
|
|
@@ -9,7 +11,7 @@ const app = new ConsoleApp({
|
|
|
9
11
|
mount: [
|
|
10
12
|
crons({
|
|
11
13
|
commanders: './src/commanders',
|
|
12
|
-
cache:
|
|
14
|
+
cache: new Caching(redisAdapter(configs.redis)),
|
|
13
15
|
port: {{cronPort}},
|
|
14
16
|
}),
|
|
15
17
|
openapi({ routers: './src/routers' }),
|
|
@@ -3,6 +3,10 @@ import { Caching } from '@aomex/cache';
|
|
|
3
3
|
import { redisAdapter } from '@aomex/cache-redis-adapter';
|
|
4
4
|
import { configs } from '@configs';
|
|
5
5
|
|
|
6
|
-
export const
|
|
6
|
+
export const cache = new Caching(redisAdapter(configs.redis));
|
|
7
7
|
|
|
8
|
-
export class CacheService extends Service {
|
|
8
|
+
export class CacheService extends Service {
|
|
9
|
+
protected override async init(): Promise<void> {
|
|
10
|
+
await cache.adapter.connect();
|
|
11
|
+
}
|
|
12
|
+
}
|