@clonegod/ttd-core 2.1.20 → 2.1.22

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.
@@ -608,7 +608,6 @@ class ArbCache {
608
608
  if ((0, index_1.isEmpty)(group_id)) {
609
609
  throw new Error(`get_trade_service_by_group_id_no_cache, invalid group_id=${group_id}, return`);
610
610
  }
611
- (0, index_1.log_info)(`get_trade_service_by_group_id_no_cache, group_id=${group_id}, start`);
612
611
  let res = yield this.loading_cache.hget(this.chain_id, index_1.CACHE_KEY_TYPE.CONFIG_TRADE_SERVICE, group_id);
613
612
  let { key, field, value } = res;
614
613
  let trade_group;
@@ -619,7 +618,6 @@ class ArbCache {
619
618
  else {
620
619
  throw new Error(`get_trade_service_by_group_id_no_cache, failed! group_id=${group_id}, not exist!`);
621
620
  }
622
- (0, index_1.log_info)(`get_trade_service_by_group_id_no_cache, end`);
623
621
  return trade_group;
624
622
  });
625
623
  }
@@ -1,3 +1,3 @@
1
1
  export declare function getServerIpList(): string[];
2
- export declare function getNextIP(): string;
2
+ export declare function getNextIP(): string | undefined;
3
3
  export declare function getCurrentIpList(): string[];
@@ -80,11 +80,14 @@ function getNextIP() {
80
80
  if (IP_LIST.length === 0) {
81
81
  IP_LIST = getServerIpList();
82
82
  }
83
+ if (IP_LIST.length === 0) {
84
+ return undefined;
85
+ }
83
86
  return IP_LIST[ip_counter++ % IP_LIST.length];
84
87
  }
85
88
  catch (err) {
86
89
  console.error('[IpUtil] getNextIP error!!!', err);
87
- throw err;
90
+ return undefined;
88
91
  }
89
92
  }
90
93
  function getCurrentIpList() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@clonegod/ttd-core",
3
- "version": "2.1.20",
3
+ "version": "2.1.22",
4
4
  "description": "Common types and utilities for trading systems - use `npm run push` to publish",
5
5
  "main": "dist/index.js",
6
6
  "types": "types/index.d.ts",