MCPcopy Create free account
hub / github.com/AnukarOP/claude-code-leaked / ensureTaskListLockFile

Function ensureTaskListLockFile

source code/utils/tasks.ts:513–525  ·  view source on GitHub ↗

* Ensures the lock file exists for a task list

(taskListId: string)

Source from the content-addressed store, hash-verified

511 * Ensures the lock file exists for a task list
512 */
513async function ensureTaskListLockFile(taskListId: string): Promise<string> {
514 await ensureTasksDir(taskListId)
515 const lockPath = getTaskListLockPath(taskListId)
516 // proper-lockfile requires the target file to exist. Create it with the
517 // 'wx' flag (write-exclusive) so concurrent callers don't both create it,
518 // and the first one to create wins silently.
519 try {
520 await writeFile(lockPath, '', { flag: 'wx' })
521 } catch {
522 // EEXIST or other — file already exists, which is fine.
523 }
524 return lockPath
525}
526
527export type ClaimTaskOptions = {
528 /**

Callers 3

resetTaskListFunction · 0.85
createTaskFunction · 0.85
claimTaskWithBusyCheckFunction · 0.85

Calls 2

ensureTasksDirFunction · 0.85
getTaskListLockPathFunction · 0.85

Tested by

no test coverage detected