@clonegod/ttd-sui-common 1.0.43 → 1.0.44

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.
@@ -83,6 +83,7 @@ class SimpleRedisClient {
83
83
  if (acquired)
84
84
  break;
85
85
  yield new Promise(resolve => setTimeout(resolve, this.lockRetryDelayMs));
86
+ (0, dist_1.log_warn)(`withLock failed: lock_key=${lock_key}, lock_value=${lock_value}, retry times=${retries}`);
86
87
  retries++;
87
88
  }
88
89
  if (acquired) {
@@ -93,7 +94,9 @@ class SimpleRedisClient {
93
94
  finally {
94
95
  if (acquired) {
95
96
  const release_delay = parseInt(process.env.NONCE_LOCK_RELEASE_DELAY_MS || String(release_lock_delay_ms));
96
- yield (0, dist_1.sleep)(release_delay);
97
+ if (release_delay > 0) {
98
+ yield (0, dist_1.sleep)(release_delay);
99
+ }
97
100
  yield this.releaseLock(lock_key, lock_value);
98
101
  (0, dist_1.log_info)(`withLock success: lock_key=${lock_key}, lock_value=${lock_value}, retry times=${retries}, get lock take ${get_lock_time - first_try_time}ms, release_delay=${release_delay}ms, hold lock ${Date.now() - get_lock_time}ms`);
99
102
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@clonegod/ttd-sui-common",
3
- "version": "1.0.43",
3
+ "version": "1.0.44",
4
4
  "description": "Sui common library",
5
5
  "license": "UNLICENSED",
6
6
  "main": "dist/index.js",