@jayfong/x-server 2.1.5 → 2.1.7

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.
@@ -189,6 +189,7 @@ _yargs.default.command('dev', '开始开发', _ => _.positional('index', {
189
189
  host: process.env.HOST,
190
190
  user: process.env.USER,
191
191
  key: process.env.KEY,
192
- dir: process.env.DIR
192
+ dir: process.env.DIR,
193
+ cmd: process.env.CMD
193
194
  });
194
195
  }).parse();
@@ -47,7 +47,8 @@ class DeployUtil {
47
47
  set -ex
48
48
  tar -zxvf ${remoteAppFile} -C ${appDir}
49
49
  cd ${appDir}/dist
50
- [ -f no_install.lock ] && yarn_disable_self_update_check=true tyn
50
+ [ -f no_install.lock ] && yarn_disable_self_update_check=true tyn
51
+ ${options.cmd || ''}
51
52
  pm2 startOrReload pm2.config.js
52
53
  `, {
53
54
  cwd: options.cwd,
@@ -33,11 +33,11 @@ class CacheService {
33
33
 
34
34
 
35
35
  async set(key, value, ttl = this.options.ttl) {
36
- const redisKey = this.toRedisKey(key);
37
- const redisValue = JSON.stringify(value);
38
36
  const redisTtl = typeof ttl === 'function' ? ttl(value, this.options.ttl) : ttl;
39
37
 
40
38
  if (redisTtl) {
39
+ const redisKey = this.toRedisKey(key);
40
+ const redisValue = JSON.stringify(value);
41
41
  await _x.x.redis.set(redisKey, redisValue, // 毫秒
42
42
  'PX', (0, _date.ms)(redisTtl));
43
43
  }
package/lib/cli/cli.js CHANGED
@@ -171,6 +171,7 @@ yargs.command('dev', '开始开发', _ => _.positional('index', {
171
171
  host: process.env.HOST,
172
172
  user: process.env.USER,
173
173
  key: process.env.KEY,
174
- dir: process.env.DIR
174
+ dir: process.env.DIR,
175
+ cmd: process.env.CMD
175
176
  });
176
177
  }).parse();
@@ -4,6 +4,7 @@ export interface DeployOptions {
4
4
  user: string;
5
5
  key: string;
6
6
  dir: string;
7
+ cmd?: string;
7
8
  }
8
9
  export declare class DeployUtil {
9
10
  static deploy(options: DeployOptions): Promise<void>;
@@ -35,7 +35,8 @@ export class DeployUtil {
35
35
  set -ex
36
36
  tar -zxvf ${remoteAppFile} -C ${appDir}
37
37
  cd ${appDir}/dist
38
- [ -f no_install.lock ] && yarn_disable_self_update_check=true tyn
38
+ [ -f no_install.lock ] && yarn_disable_self_update_check=true tyn
39
+ ${options.cmd || ''}
39
40
  pm2 startOrReload pm2.config.js
40
41
  `, {
41
42
  cwd: options.cwd,
@@ -23,11 +23,11 @@ export class CacheService {
23
23
 
24
24
 
25
25
  async set(key, value, ttl = this.options.ttl) {
26
- const redisKey = this.toRedisKey(key);
27
- const redisValue = JSON.stringify(value);
28
26
  const redisTtl = typeof ttl === 'function' ? ttl(value, this.options.ttl) : ttl;
29
27
 
30
28
  if (redisTtl) {
29
+ const redisKey = this.toRedisKey(key);
30
+ const redisValue = JSON.stringify(value);
31
31
  await x.redis.set(redisKey, redisValue, // 毫秒
32
32
  'PX', ms(redisTtl));
33
33
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jayfong/x-server",
3
- "version": "2.1.5",
3
+ "version": "2.1.7",
4
4
  "license": "ISC",
5
5
  "sideEffects": false,
6
6
  "main": "lib/_cjs/index.js",