fix(daemon): Ensure robust process shutdown and improve logs/subscriber diagnostics
This commit is contained in:
@@ -144,6 +144,13 @@ export function registerLogsCommand(smartcli: plugins.smartcli.Smartcli) {
|
||||
|
||||
await withStreamingLifecycle(
|
||||
async () => {
|
||||
// Optional: debug subscribers if requested via env (hidden)
|
||||
if (process.env.TSPM_DEBUG === 'true') {
|
||||
try {
|
||||
const subInfo = await tspmIpcClient.request('logs:subscribers' as any, { id });
|
||||
console.log(`[DEBUG] Subscribers for logs.${id}: ${subInfo.count} (${(subInfo.subscribers||[]).join(',')})`);
|
||||
} catch {}
|
||||
}
|
||||
await tspmIpcClient.subscribe(id, (log: any) => {
|
||||
// Reset sequence if runId changed (e.g., process restarted)
|
||||
if (log.runId && log.runId !== lastRunId) {
|
||||
|
Reference in New Issue
Block a user