(lock: AsyncLock, func: Function, message: string)
| 400 | } |
| 401 | |
| 402 | export 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 | |
| 416 | const LOCAL_KEY = 'git.local'; |
| 417 |
no outgoing calls
no test coverage detected