create-aomex 0.0.59 → 0.0.61

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.59",
3
+ "version": "0.0.61",
4
4
  "repository": "git@github.com:aomex/create-aomex.git",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -14,7 +14,7 @@ then
14
14
  # exit 137 SIGKILL
15
15
  { sudo docker compose --file $docker_compose_file exec -it $cron_service_name /bin/sh -c "npx aomex cron:stop" || :; }
16
16
  # against restart=always
17
- sudo docker compose --file $docker_compose_file stop $cron_service_name
17
+ sudo docker compose --file $docker_compose_file stop $cron_service_name -t=1
18
18
  fi
19
19
 
20
20
  sudo docker compose --file $docker_compose_file up -d --timeout=1 --remove-orphans
@@ -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
+ }