@clonegod/ttd-bsc-common 1.0.17 → 1.0.18
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.
|
@@ -17,7 +17,7 @@ class SimpleRedisClient {
|
|
|
17
17
|
this.redisClient = null;
|
|
18
18
|
this.lockMaxRetries = 10;
|
|
19
19
|
this.lockRetryDelayMs = 300;
|
|
20
|
-
this.lockExpireSeconds =
|
|
20
|
+
this.lockExpireSeconds = 3;
|
|
21
21
|
}
|
|
22
22
|
getRedisClient() {
|
|
23
23
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -96,7 +96,7 @@ class SimpleRedisClient {
|
|
|
96
96
|
const release_delay = parseInt(process.env.NONCE_LOCK_RELEASE_DELAY_MS || String(release_lock_delay_ms));
|
|
97
97
|
yield (0, dist_1.sleep)(release_delay);
|
|
98
98
|
yield this.releaseLock(lock_key, lock_value);
|
|
99
|
-
(0, dist_1.log_info)(`withLock success: lock_key=${lock_key}, lock_value=${lock_value}, get lock take ${get_lock_time - first_try_time}ms, release_delay=${release_delay}ms, hold lock ${Date.now() - get_lock_time}ms`);
|
|
99
|
+
(0, dist_1.log_info)(`withLock success: lock_key=${lock_key}, lock_value=${lock_value}, after ${this.lockMaxRetries} retries, get lock take ${get_lock_time - first_try_time}ms, release_delay=${release_delay}ms, hold lock ${Date.now() - get_lock_time}ms`);
|
|
100
100
|
}
|
|
101
101
|
else {
|
|
102
102
|
(0, dist_1.log_warn)(`withLock failed: lock_key=${lock_key}, lock_value=${lock_value}, after ${this.lockMaxRetries} retries, took ${Date.now() - first_try_time}ms`);
|