mirror of
https://github.com/thedotmack/claude-mem
synced 2026-04-25 17:15:04 +02:00
Revert "revert: roll back v12.3.3 (Issue Blowout 2026)"
This reverts commit bfc7de377a.
This commit is contained in:
@@ -108,12 +108,22 @@ try {
|
||||
// Trigger worker restart after file sync
|
||||
console.log('\n🔄 Triggering worker restart...');
|
||||
const http = require('http');
|
||||
const fs = require('fs');
|
||||
const os = require('os');
|
||||
// Read auth token for API auth (#1932/#1933)
|
||||
const dataDir = process.env.CLAUDE_MEM_DATA_DIR || require('path').join(os.homedir(), '.claude-mem');
|
||||
let authToken = '';
|
||||
try { authToken = fs.readFileSync(require('path').join(dataDir, 'worker-auth-token'), 'utf-8').trim(); } catch {}
|
||||
// Use per-user port derivation (#1936)
|
||||
const uid = typeof process.getuid === 'function' ? process.getuid() : 77;
|
||||
const workerPort = parseInt(process.env.CLAUDE_MEM_WORKER_PORT || String(37700 + (uid % 100)), 10);
|
||||
const req = http.request({
|
||||
hostname: '127.0.0.1',
|
||||
port: 37777,
|
||||
port: workerPort,
|
||||
path: '/api/admin/restart',
|
||||
method: 'POST',
|
||||
timeout: 2000
|
||||
timeout: 2000,
|
||||
headers: authToken ? { 'Authorization': `Bearer ${authToken}` } : {}
|
||||
}, (res) => {
|
||||
if (res.statusCode === 200) {
|
||||
console.log('\x1b[32m%s\x1b[0m', '✓ Worker restart triggered');
|
||||
|
||||
Reference in New Issue
Block a user