MCPcopy Index your code
hub / github.com/claude-code-best/claude-code / ensureTaskListLockFile

Function ensureTaskListLockFile

src/utils/tasks.ts:511–523  ·  view source on GitHub ↗

* Ensures the lock file exists for a task list

(taskListId: string)

Source from the content-addressed store, hash-verified

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

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