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

Function runWithLock

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

Source from the content-addressed store, hash-verified

400}
401
402export async function runWithLock(lock: AsyncLock, func: Function, message: string) {
403 try {
404 const acquired = await lock.acquire();
405 if (!acquired) {
406 console.warn(message);
407 }
408
409 const result = await func();
410 return result;
411 } finally {
412 lock.release();
413 }
414}
415
416const LOCAL_KEY = 'git.local';
417

Callers 15

persistEntryMethod · 0.90
persistEntryMethod · 0.90
persistEntryMethod · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected