MCPcopy Create free account
hub / github.com/decaporg/decap-cms / runWithLock

Function runWithLock

packages/decap-cms-lib-util/src/implementation.ts:433–445  ·  view source on GitHub ↗
(lock: AsyncLock, func: Function, message: string)

Source from the content-addressed store, hash-verified

431}
432
433export async function runWithLock(lock: AsyncLock, func: Function, message: string) {
434 try {
435 const acquired = await lock.acquire();
436 if (!acquired) {
437 console.warn(message);
438 }
439
440 const result = await func();
441 return result;
442 } finally {
443 lock.release();
444 }
445}
446
447const LOCAL_KEY = 'git.local';
448

Callers 15

persistEntryMethod · 0.90
persistEntryMethod · 0.90
persistEntryMethod · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected