* Resolve the sentinel target file `proper-lockfile` locks against. * `proper-lockfile.lock(target)` creates `${target}.lock` as the * actual lock directory, so the real lockfile on disk ends up at * `{configDir}/oauth/{providerName}.lock`. Returns `undefined` when * locking is opted out
()
| 180 | * locking is opted out (no configDir, Windows, env kill switch). |
| 181 | */ |
| 182 | private resolveLockTarget(): string | undefined { |
| 183 | if (process.platform === 'win32') return undefined; |
| 184 | if (process.env['KIMI_DISABLE_OAUTH_LOCK'] === '1') return undefined; |
| 185 | if (this.configDir === undefined) return undefined; |
| 186 | return `${this.configDir}/oauth/${this.config.name}`; |
| 187 | } |
| 188 | |
| 189 | /** |
| 190 | * Acquire the cross-process lock around the refresh critical section. |