Migration: drop the /proc scan for servers from before the lock, and the fixture generator
The migration only matters for data from before libraries, and the README says to stop the server first; the lock check stays. make.ts rebuilt the committed fixtures from two old commits and will not be run again (the test's header names the commits). isDir was used by nothing. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014yB6q4BHMwptTX3YFtkRab
This commit is contained in:
1 parent
d8654fdd19
commit
9c506cd660
5 files changed
+18
-326
No files matched your search
@@ -37,7 +37,7 @@
|
||||
*
|
||||
* Run again, it does nothing (the libraries layout is there and no old files are left). If a
|
||||
* migration stopped after the commit step, a second run only moves the old files aside. It will
|
||||
* not run while a server has the data directory open (lock.ts).
|
||||
* not run while a server holds the data directory's lock (lock.ts).
|
||||
*/
|
||||
import { existsSync, mkdirSync, readFileSync, readdirSync, renameSync, rmSync, writeFileSync } from "node:fs";
|
||||
import { join, resolve as resolvePath } from "node:path";
|
||||
@@ -47,7 +47,7 @@ import { Doc, NOLINK, ancestors, isStale, label, notesOf, sections, staleness, t
|
||||
import { canonRef } from "../src/core/ref";
|
||||
import { digest } from "../src/core/text";
|
||||
import { LIBRARIES, OLD_FILES, indexText, layout, stamp, type LibraryEntry } from "./libraries";
|
||||
import { busy } from "./lock";
|
||||
import { lockHolder } from "./lock";
|
||||
import { dataDir } from "./util";
|
||||
|
||||
export interface MigrateOptions {
|
||||
@@ -95,7 +95,8 @@ export function migrateLibraries(dataIn: string, o: MigrateOptions = {}): Migrat
|
||||
log(msg);
|
||||
return { status: "refused", problems: [msg] };
|
||||
}
|
||||
const why = busy(data);
|
||||
const lock = lockHolder(data);
|
||||
const why = lock && `a server (pid ${lock.pid}${lock.port ? `, port ${lock.port}` : ""}) has ${data} open`;
|
||||
if (why && !o.check) {
|
||||
const msg = `Refusing to migrate: ${why}. Stop it first.`;
|
||||
log(msg);
|
||||
|
||||
Reference in new issue
Block a user