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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-aomex",
3
- "version": "0.0.58",
3
+ "version": "0.0.60",
4
4
  "repository": "git@github.com:aomex/create-aomex.git",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -4,6 +4,10 @@ services:
4
4
  command: npx prisma migrate deploy
5
5
  api:
6
6
  image: {{projectName}}:production
7
+ ulimits:
8
+ nofile:
9
+ soft: 65535
10
+ hard: 65535
7
11
  ports:
8
12
  - 3000:3000
9
13
  cron:
@@ -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: redisCache,
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 redisCache = new Caching(redisAdapter(configs.redis));
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
+ }