Renames
This commit is contained in:
parent
49493d80be
commit
84d450a931
|
@ -46,7 +46,7 @@ async function put(
|
||||||
{
|
{
|
||||||
type: LockType.TRY_ONCE,
|
type: LockType.TRY_ONCE,
|
||||||
name: LockName.PERSIST_WRITETHROUGH,
|
name: LockName.PERSIST_WRITETHROUGH,
|
||||||
nameSuffix: key,
|
resource: key,
|
||||||
ttl: 1000,
|
ttl: 1000,
|
||||||
},
|
},
|
||||||
async () => {
|
async () => {
|
||||||
|
|
|
@ -88,8 +88,8 @@ export const doWithLock = async <T>(
|
||||||
let name: string = `lock:${prefix}_${opts.name}`
|
let name: string = `lock:${prefix}_${opts.name}`
|
||||||
|
|
||||||
// add additional unique name if required
|
// add additional unique name if required
|
||||||
if (opts.nameSuffix) {
|
if (opts.resource) {
|
||||||
name = name + `_${opts.nameSuffix}`
|
name = name + `_${opts.resource}`
|
||||||
}
|
}
|
||||||
|
|
||||||
// create the lock
|
// create the lock
|
||||||
|
|
|
@ -30,9 +30,9 @@ export interface LockOptions {
|
||||||
*/
|
*/
|
||||||
ttl: number
|
ttl: number
|
||||||
/**
|
/**
|
||||||
* The suffix to add to the lock name for additional uniqueness
|
* The resource to the lock name
|
||||||
*/
|
*/
|
||||||
nameSuffix?: string
|
resource?: string
|
||||||
/**
|
/**
|
||||||
* This is a system-wide lock - don't use tenancy in lock key
|
* This is a system-wide lock - don't use tenancy in lock key
|
||||||
*/
|
*/
|
||||||
|
|
Loading…
Reference in New Issue