baja-lite 1.3.43 → 1.3.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.
- package/package.json +1 -1
- package/sql.js +3 -3
package/package.json
CHANGED
package/sql.js
CHANGED
|
@@ -4588,13 +4588,13 @@ export async function excuteWithLock(config, fn__) {
|
|
|
4588
4588
|
}
|
|
4589
4589
|
else {
|
|
4590
4590
|
logger.debug(`get lock ${key} ok!`);
|
|
4591
|
-
await db.
|
|
4591
|
+
await db.pexpire(key, config.lockMaxTime ?? 60000);
|
|
4592
4592
|
try {
|
|
4593
4593
|
return await fn__();
|
|
4594
4594
|
}
|
|
4595
4595
|
finally {
|
|
4596
4596
|
logger.debug(`unlock ${key} ok!`);
|
|
4597
|
-
await db.
|
|
4597
|
+
await db.decr(key);
|
|
4598
4598
|
}
|
|
4599
4599
|
}
|
|
4600
4600
|
};
|
|
@@ -4710,7 +4710,7 @@ export function MethodCache(config) {
|
|
|
4710
4710
|
descriptor.value = async function (...args) {
|
|
4711
4711
|
const key = typeof config.key === 'function' ? config.key.call(this, ...args) : config.key;
|
|
4712
4712
|
const db = getRedisDB();
|
|
4713
|
-
const cache = await db.get(
|
|
4713
|
+
const cache = await db.get(`[cache]${key}`);
|
|
4714
4714
|
if (cache) {
|
|
4715
4715
|
logger.debug(`cache ${key} hit!`);
|
|
4716
4716
|
return JSON.parse(cache);
|