/** * Update Lock * Issue #1198: guard `POST /api/app/update` against concurrent self-updates. * * Design constraints: * - Acquisition is a single O_EXCL create (mirrors PidManager.writePid), so two * concurrent requests cannot both win. * - A successful update restarts the server, so nothing survives to release the * lock. Timeout expiry is therefore the primary release path, and * releaseUpdateLock() exists only for the spawn-failed case. * * @module lib/app-update/update-lock */ /** Lock file name inside the config directory */ export declare const UPDATE_LOCK_FILENAME = "update.lock"; /** * Age after which a lock is considered abandoned. * `commandmate update` takes tens of seconds (npm install dominates); 10 minutes * is well clear of that while still recovering from a killed update process. */ export declare const UPDATE_LOCK_TIMEOUT_MS: number; /** * Absolute path of the update lock file. */ export declare function getUpdateLockPath(): string; /** * Take the update lock. * * @param now - Current epoch ms (injectable for tests) * @returns true when the caller now holds the lock, false when an update is in progress */ export declare function acquireUpdateLock(now?: number): boolean; /** * Drop the update lock. * Only meaningful when the update never started (spawn failure): a started * update replaces this process, so the lock outlives it until it expires. */ export declare function releaseUpdateLock(): void; //# sourceMappingURL=update-lock.d.ts.map