@stacksjs/actions 0.70.296 → 0.70.297

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/queue/work.js +1 -1
  2. package/package.json +18 -18
@@ -1 +1 @@
1
- import process from"node:process";import{log}from"@stacksjs/logging";import{startProcessor,stopProcessor}from"@stacksjs/queue";process.on("unhandledRejection",(reason)=>{log.error(`Unhandled Rejection in queue worker: ${reason}`)});process.on("uncaughtException",(error)=>{log.error(`Uncaught Exception in queue worker: ${error.message}`)});const SHUTDOWN_GRACE_MS=Number(process.env.STACKS_QUEUE_SHUTDOWN_GRACE_MS)||1e4;let shuttingDown=!1;async function gracefulShutdown(signal){if(shuttingDown)return;shuttingDown=!0;log.info(`[queue] Worker received ${signal}, draining in-flight jobs (max ${SHUTDOWN_GRACE_MS/1000}s)\u2026`);setTimeout(()=>{log.warn("[queue] Drain window exceeded \u2014 forcing worker exit.");process.exit(1)},SHUTDOWN_GRACE_MS+2000).unref();try{await stopProcessor({graceMs:SHUTDOWN_GRACE_MS})}catch(error){log.error("[queue] Error while draining worker on shutdown:",error)}process.exit(0)}process.on("SIGTERM",()=>{gracefulShutdown("SIGTERM")});process.on("SIGINT",()=>{gracefulShutdown("SIGINT")});const options=parseArgs(),queue=options.queue,concurrency=Number(options.concurrency)||1;log.info(`Starting queue worker with ${concurrency} concurrent worker(s)...`);const result=await startProcessor(queue,{concurrency});if(result.isErr){log.error("Failed to start queue worker:",result.error);process.exit(1)}log.success("Queue worker started successfully!");await new Promise(()=>{});function parseArgs(){const args={};process.argv.forEach((arg)=>{if(arg.startsWith("--")){const[key,value]=arg.slice(2).split("=");if(key&&value)args[key]=value;else if(key)args[key]="true"}});return args}
1
+ import process from"node:process";import{log}from"@stacksjs/logging";import{startProcessor,stopProcessor}from"@stacksjs/queue";process.on("unhandledRejection",(reason)=>{log.error(`Unhandled Rejection in queue worker: ${reason}`)});process.on("uncaughtException",(error)=>{log.error(`Uncaught Exception in queue worker: ${error.message}`)});const SHUTDOWN_GRACE_MS=Number(process.env.STACKS_QUEUE_SHUTDOWN_GRACE_MS)||1e4;let shuttingDown=!1;async function gracefulShutdown(signal){if(shuttingDown)return;shuttingDown=!0;log.info(`[queue] Worker received ${signal}, draining in-flight jobs (max ${SHUTDOWN_GRACE_MS/1000}s)\u2026`);setTimeout(()=>{log.warn("[queue] Drain window exceeded \u2014 forcing worker exit.");process.exit(1)},SHUTDOWN_GRACE_MS+2000).unref();try{await stopProcessor({graceMs:SHUTDOWN_GRACE_MS})}catch(error){log.error("[queue] Error while draining worker on shutdown:",error)}process.exit(0)}process.on("SIGTERM",()=>{gracefulShutdown("SIGTERM")});process.on("SIGINT",()=>{gracefulShutdown("SIGINT")});const options=parseArgs(),queue=options.queue,concurrency=Number(options.concurrency)||1;log.info(`Starting queue worker with ${concurrency} concurrent worker(s)...`);const result=await startProcessor(queue,{concurrency});if(result.isErr){log.error("Failed to start queue worker:",result.error);process.exit(1)}log.success("Queue worker started successfully!");await new Promise(()=>{});function parseArgs(){const args={},argv=process.argv;for(let index=0;index<argv.length;index++){const arg=argv[index];if(!arg?.startsWith("--"))continue;const[key,inline]=arg.slice(2).split("=");if(!key)continue;if(inline!==void 0){args[key]=inline;continue}const next=argv[index+1];if(next!==void 0&&!next.startsWith("-")){args[key]=next;index++;continue}args[key]="true"}return args}
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@stacksjs/actions",
3
3
  "type": "module",
4
4
  "sideEffects": false,
5
- "version": "0.70.296",
5
+ "version": "0.70.297",
6
6
  "description": "The Stacks actions.",
7
7
  "author": "Chris Breuer",
8
8
  "contributors": [
@@ -59,33 +59,33 @@
59
59
  "prepublishOnly": "bun run build"
60
60
  },
61
61
  "dependencies": {
62
- "@stacksjs/config": "0.70.296",
62
+ "@stacksjs/config": "0.70.297",
63
63
  "@stacksjs/bumpx": "^0.2.6",
64
64
  "@stacksjs/bunpress": "^0.1.18",
65
65
  "@stacksjs/logsmith": "^0.2.3",
66
- "@stacksjs/registry": "0.70.296",
66
+ "@stacksjs/registry": "0.70.297",
67
67
  "@stacksjs/stx": "^0.2.148",
68
68
  "@stacksjs/ts-cloud": "^0.7.103",
69
69
  "@stacksjs/ts-md": "^0.1.1"
70
70
  },
71
71
  "devDependencies": {
72
- "@stacksjs/api": "0.70.296",
73
- "@stacksjs/cli": "0.70.296",
74
- "@stacksjs/database": "0.70.296",
72
+ "@stacksjs/api": "0.70.297",
73
+ "@stacksjs/cli": "0.70.297",
74
+ "@stacksjs/database": "0.70.297",
75
75
  "@stacksjs/tlsx": "^0.13.2",
76
76
  "better-dx": "^0.2.17",
77
- "@stacksjs/dns": "0.70.296",
78
- "@stacksjs/enums": "0.70.296",
79
- "@stacksjs/env": "0.70.296",
80
- "@stacksjs/error-handling": "0.70.296",
81
- "@stacksjs/image": "0.70.296",
82
- "@stacksjs/logging": "0.70.296",
83
- "@stacksjs/path": "0.70.296",
84
- "@stacksjs/security": "0.70.296",
85
- "@stacksjs/storage": "0.70.296",
86
- "@stacksjs/strings": "0.70.296",
87
- "@stacksjs/utils": "0.70.296",
88
- "@stacksjs/validation": "0.70.296"
77
+ "@stacksjs/dns": "0.70.297",
78
+ "@stacksjs/enums": "0.70.297",
79
+ "@stacksjs/env": "0.70.297",
80
+ "@stacksjs/error-handling": "0.70.297",
81
+ "@stacksjs/image": "0.70.297",
82
+ "@stacksjs/logging": "0.70.297",
83
+ "@stacksjs/path": "0.70.297",
84
+ "@stacksjs/security": "0.70.297",
85
+ "@stacksjs/storage": "0.70.297",
86
+ "@stacksjs/strings": "0.70.297",
87
+ "@stacksjs/utils": "0.70.297",
88
+ "@stacksjs/validation": "0.70.297"
89
89
  },
90
90
  "peerDependencies": {
91
91
  "pickier": "^0.1.35"