diff --git a/packages/backend-core/src/redis/redlockImpl.ts b/packages/backend-core/src/redis/redlockImpl.ts index a65dcd0c3f..a7b2e2b4c6 100644 --- a/packages/backend-core/src/redis/redlockImpl.ts +++ b/packages/backend-core/src/redis/redlockImpl.ts @@ -101,7 +101,7 @@ function getLockName(opts: LockOptions) { return name } -export const autoExtendPollingMs = Duration.fromSeconds(10).toMs() +export const AUTO_EXTEND_POLLING_MS = Duration.fromSeconds(10).toMs() export async function doWithLock( opts: LockOptions, @@ -114,7 +114,7 @@ export async function doWithLock( const name = getLockName(opts) const ttl = - opts.type === LockType.AUTO_EXTEND ? autoExtendPollingMs : opts.ttl + opts.type === LockType.AUTO_EXTEND ? AUTO_EXTEND_POLLING_MS : opts.ttl // create the lock lock = await redlock.lock(name, ttl) diff --git a/packages/backend-core/src/redis/tests/redlockImpl.spec.ts b/packages/backend-core/src/redis/tests/redlockImpl.spec.ts index 6f894c2951..70920366ee 100644 --- a/packages/backend-core/src/redis/tests/redlockImpl.spec.ts +++ b/packages/backend-core/src/redis/tests/redlockImpl.spec.ts @@ -1,5 +1,5 @@ import { LockName, LockType, LockOptions } from "@budibase/types" -import { autoExtendPollingMs, doWithLock } from "../redlockImpl" +import { AUTO_EXTEND_POLLING_MS, doWithLock } from "../redlockImpl" import { DBTestConfiguration, generator } from "../../../tests" describe("redlockImpl", () => { @@ -9,7 +9,7 @@ describe("redlockImpl", () => { describe("doWithLock", () => { const config = new DBTestConfiguration() - const lockTtl = autoExtendPollingMs + const lockTtl = AUTO_EXTEND_POLLING_MS function runLockWithExecutionTime({ opts,