Sync DNS2 production changes - removed obsolete test suite and refactored structure

This commit is contained in:
Krystie
2026-03-23 10:47:15 +01:00
parent 1ac50918ab
commit d76644d948
288 changed files with 8965 additions and 15731 deletions

View File

@@ -16,10 +16,10 @@ const LOCK_RETRY_OPTIONS = {
retries: 10,
minTimeout: 100,
maxTimeout: 1000,
randomize: true,
randomize: true
},
stale: LOCK_STALE_THRESHOLD,
realpath: false,
realpath: false
};
class PortLockManager {
@@ -72,7 +72,7 @@ class PortLockManager {
if (!fs.existsSync(lockFilePath)) {
fs.writeFileSync(lockFilePath, JSON.stringify({
created: new Date().toISOString(),
port,
port
}));
}
@@ -89,7 +89,7 @@ class PortLockManager {
this.activeLocks.set(lockId, {
ports: sortedPorts,
releases: releaseFunctions,
timestamp: Date.now(),
timestamp: Date.now()
});
console.log(`[PortLockManager] Successfully acquired all locks (ID: ${lockId})`);
@@ -97,13 +97,13 @@ class PortLockManager {
} catch (error) {
// Release any locks we managed to acquire
console.error('[PortLockManager] Failed to acquire all locks:', error.message);
console.error(`[PortLockManager] Failed to acquire all locks:`, error.message);
for (const release of releaseFunctions) {
try {
await release();
} catch (releaseError) {
console.error('[PortLockManager] Error releasing lock during cleanup:', releaseError.message);
console.error(`[PortLockManager] Error releasing lock during cleanup:`, releaseError.message);
}
}
@@ -132,7 +132,7 @@ class PortLockManager {
await release();
} catch (error) {
errors.push(error.message);
console.error('[PortLockManager] Error releasing lock:', error.message);
console.error(`[PortLockManager] Error releasing lock:`, error.message);
}
}
@@ -198,13 +198,13 @@ class PortLockManager {
lockId,
ports: info.ports,
age: Date.now() - info.timestamp,
timestamp: new Date(info.timestamp).toISOString(),
timestamp: new Date(info.timestamp).toISOString()
}));
return {
activeLocks: activeLocks.length,
locks: activeLocks,
lockDirectory: LOCK_DIR,
lockDirectory: LOCK_DIR
};
}