clay-server 2.20.1-beta.14 → 2.20.1-beta.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/sdk-worker.js +8 -1
- package/package.json +1 -1
package/lib/sdk-worker.js
CHANGED
|
@@ -4,6 +4,9 @@
|
|
|
4
4
|
//
|
|
5
5
|
// Usage: node sdk-worker.js <socket-path>
|
|
6
6
|
|
|
7
|
+
// Early diagnostic — writes directly to fd 2 to ensure output even if pipes close fast
|
|
8
|
+
try { require("fs").writeSync(2, "[sdk-worker] BOOT pid=" + process.pid + " uid=" + (typeof process.getuid === "function" ? process.getuid() : "?") + " argv=" + process.argv.slice(1).join(" ") + "\n"); } catch (e) {}
|
|
9
|
+
|
|
7
10
|
var net = require("net");
|
|
8
11
|
var crypto = require("crypto");
|
|
9
12
|
var path = require("path");
|
|
@@ -403,7 +406,9 @@ function cleanup() {
|
|
|
403
406
|
}
|
|
404
407
|
|
|
405
408
|
// --- Connect to daemon socket ---
|
|
409
|
+
try { require("fs").writeSync(2, "[sdk-worker] Connecting to socket: " + socketPath + "\n"); } catch (e) {}
|
|
406
410
|
conn = net.connect(socketPath, function() {
|
|
411
|
+
try { require("fs").writeSync(2, "[sdk-worker] Connected, sending ready\n"); } catch (e) {}
|
|
407
412
|
sendToDaemon({ type: "ready" });
|
|
408
413
|
});
|
|
409
414
|
|
|
@@ -429,18 +434,20 @@ conn.on("error", function(err) {
|
|
|
429
434
|
});
|
|
430
435
|
|
|
431
436
|
conn.on("close", function() {
|
|
432
|
-
|
|
437
|
+
try { require("fs").writeSync(2, "[sdk-worker] EXIT REASON: socket closed\n"); } catch (e) {}
|
|
433
438
|
cleanup();
|
|
434
439
|
process.exit(0);
|
|
435
440
|
});
|
|
436
441
|
|
|
437
442
|
// Handle process signals
|
|
438
443
|
process.on("SIGTERM", function() {
|
|
444
|
+
try { require("fs").writeSync(2, "[sdk-worker] EXIT REASON: SIGTERM\n"); } catch (e) {}
|
|
439
445
|
cleanup();
|
|
440
446
|
process.exit(0);
|
|
441
447
|
});
|
|
442
448
|
|
|
443
449
|
process.on("SIGINT", function() {
|
|
450
|
+
try { require("fs").writeSync(2, "[sdk-worker] EXIT REASON: SIGINT\n"); } catch (e) {}
|
|
444
451
|
cleanup();
|
|
445
452
|
process.exit(0);
|
|
446
453
|
});
|