@tiflis-io/tiflis-code-workstation 0.3.21 → 0.3.23

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.
Files changed (2) hide show
  1. package/dist/main.js +16 -14
  2. package/package.json +1 -1
package/dist/main.js CHANGED
@@ -2965,6 +2965,9 @@ var TerminalOutputBatcher = class {
2965
2965
  if (this.timeout === null) {
2966
2966
  const adaptiveInterval = this.outputRate > 1e3 ? this.batchIntervalMs : Math.min(8, this.batchIntervalMs);
2967
2967
  this.timeout = setTimeout(() => this.flush(), adaptiveInterval);
2968
+ if (this.timeout.unref) {
2969
+ this.timeout.unref();
2970
+ }
2968
2971
  }
2969
2972
  }
2970
2973
  /**
@@ -9206,28 +9209,27 @@ async function bootstrap() {
9206
9209
  },
9207
9210
  "Starting workstation server"
9208
9211
  );
9212
+ let shutdownInProgress = false;
9213
+ let signalCount = 0;
9209
9214
  const registerSignalHandlers = (shutdown2) => {
9210
- let signalCount = 0;
9211
9215
  const handleSignal = (signal) => {
9212
9216
  signalCount++;
9213
- logger.info({ signal, count: signalCount }, "Signal received, initiating shutdown");
9214
- if (signalCount === 1) {
9215
- console.log("\nShutting down gracefully...");
9216
- shutdown2(signal).then(() => {
9217
- process.exit(0);
9218
- }).catch((error) => {
9219
- logger.error({ error }, "Error during shutdown");
9220
- process.exit(1);
9221
- });
9222
- } else {
9223
- console.log("\nForce exiting...");
9217
+ if (shutdownInProgress) {
9224
9218
  process.exit(1);
9225
9219
  }
9220
+ shutdownInProgress = true;
9221
+ logger.info({ signal, count: signalCount }, "Signal received");
9222
+ console.log("\nShutting down...");
9223
+ shutdown2(signal).catch((error) => {
9224
+ logger.error({ error }, "Shutdown error");
9225
+ }).finally(() => {
9226
+ process.exit(0);
9227
+ });
9226
9228
  };
9227
9229
  process.on("SIGTERM", () => handleSignal("SIGTERM"));
9228
9230
  process.on("SIGINT", () => handleSignal("SIGINT"));
9229
- process.on("unhandledRejection", (reason, promise) => {
9230
- logger.error({ reason, promise }, "Unhandled rejection");
9231
+ process.on("unhandledRejection", (reason) => {
9232
+ logger.error({ reason }, "Unhandled rejection");
9231
9233
  });
9232
9234
  process.on("uncaughtException", (error) => {
9233
9235
  logger.fatal({ error }, "Uncaught exception");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tiflis-io/tiflis-code-workstation",
3
- "version": "0.3.21",
3
+ "version": "0.3.23",
4
4
  "description": "Workstation server for tiflis-code - manages agent sessions and terminal access",
5
5
  "author": "Roman Barinov <rbarinov@gmail.com>",
6
6
  "license": "FSL-1.1-NC",