@clonegod/ttd-core 2.1.20 → 2.1.21

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.
@@ -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.21",
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",