vona-module-a-redlock 5.0.24 → 5.0.26

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.
Files changed (2) hide show
  1. package/dist/index.js +2 -1
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -1,6 +1,7 @@
1
1
  import { BeanInfo, BeanBase, instanceDesp, BeanScopeBase, SymbolModuleBelong } from 'vona';
2
2
  import { Redlock } from '@sesamecare-oss/redlock';
3
3
  import { Service, Scope } from 'vona-module-a-bean';
4
+ import { getRedisClientKeyPrefix } from 'vona-module-a-redis';
4
5
 
5
6
  var _dec$1, _dec2$1, _class$1;
6
7
  let ServiceRedlock = (_dec$1 = Service(), _dec2$1 = BeanInfo({
@@ -15,7 +16,7 @@ let ServiceRedlock = (_dec$1 = Service(), _dec2$1 = BeanInfo({
15
16
  const redlock = options?.redlock ?? this.redlockDefault;
16
17
  const lockTTL = options?.lockTTL ?? this.scope.config.redlock.lockTTL;
17
18
  // resource
18
- const _lockResource = `redlock_${this.app.name}:${instanceDesp(instanceName)}:${resource}`;
19
+ const _lockResource = `${getRedisClientKeyPrefix('redlock', this.app)}${instanceDesp(instanceName)}:${resource}`;
19
20
  // lock
20
21
  let _lock = await redlock.acquire([_lockResource], lockTTL);
21
22
  // timer
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "vona-module-a-redlock",
3
3
  "type": "module",
4
- "version": "5.0.24",
4
+ "version": "5.0.26",
5
5
  "title": "a-redlock",
6
6
  "vonaModule": {
7
7
  "dependencies": {},