mirror of
https://github.com/mendableai/firecrawl.git
synced 2024-11-16 11:42:24 +08:00
fix(auth): move redlock settings
This commit is contained in:
parent
2c96d2eef6
commit
eef116bef8
|
@ -43,10 +43,7 @@ export async function setCachedACUC(api_key: string, acuc: AuthCreditUsageChunk
|
||||||
const lockTTL = 10000; // 10 seconds
|
const lockTTL = 10000; // 10 seconds
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const lock = await redlock.acquire([redLockKey], lockTTL, {
|
const lock = await redlock.acquire([redLockKey], lockTTL);
|
||||||
retryCount: 200,
|
|
||||||
retryDelay: 100,
|
|
||||||
});
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
if (typeof acuc === "function") {
|
if (typeof acuc === "function") {
|
||||||
|
|
|
@ -10,12 +10,9 @@ export const redlock = new Redlock(
|
||||||
// http://redis.io/topics/distlock
|
// http://redis.io/topics/distlock
|
||||||
driftFactor: 0.01, // multiplied by lock ttl to determine drift time
|
driftFactor: 0.01, // multiplied by lock ttl to determine drift time
|
||||||
|
|
||||||
// The max number of times Redlock will attempt to lock a resource
|
retryCount: 200,
|
||||||
// before erroring.
|
|
||||||
retryCount: 5,
|
retryDelay: 100,
|
||||||
|
|
||||||
// the time in ms between attempts
|
|
||||||
retryDelay: 100, // time in ms
|
|
||||||
|
|
||||||
// the max time in ms randomly added to retries
|
// the max time in ms randomly added to retries
|
||||||
// to improve performance under high contention
|
// to improve performance under high contention
|
||||||
|
|
Loading…
Reference in New Issue
Block a user