(lock: AsyncLock, func: Function, message: string)
| 431 | } |
| 432 | |
| 433 | export 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 | |
| 447 | const LOCAL_KEY = 'git.local'; |
| 448 |
no outgoing calls
no test coverage detected