@stacksjs/actions 0.74.63 → 0.74.64
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/dist/queue/failed.js +1 -1
- package/package.json +41 -41
package/dist/queue/failed.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import process from"node:process";import{log}from"@stacksjs/logging";import{FailedJob}from"@stacksjs/orm";const options=parseArgs(),{queue:queueName,since:sinceArg}=options,sinceCutoff=sinceArg?parseSinceDuration(sinceArg):null;try{log.info(`Fetching failed jobs...
|
|
2
|
-
`);let failedJobs;if(queueName)failedJobs=await FailedJob.where("queue",queueName).get();else failedJobs=await FailedJob.all();if(sinceCutoff)failedJobs=failedJobs.filter((j)=>{if(!j.failed_at)return!1;const ts=Date.parse(j.failed_at);return Number.isFinite(ts)&&ts>=sinceCutoff});if(failedJobs.length===0){if(sinceCutoff)console.log(`\u2713 No failed jobs found since ${sinceArg}`);else console.log("\u2713 No failed jobs found");process.exit(0)}console.log("\u250C\u2500\u2500\u2500\u2500\u2500\u252C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u252C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u252C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510");console.log("\u2502 ID \u2502 Queue \u2502 Failed At \u2502 Exception \u2502");console.log("\u251C\u2500\u2500\u2500\u2500\u2500\u253C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2524");for(const job of failedJobs){const id=String(job.id).padEnd(3),queue=(job.queue||"default").substring(0,48).padEnd(48),failedAt=(job.failed_at||"N/A").substring(0,21).padEnd(21),exception=(job.exception||"Unknown error").substring(0,31).padEnd(31);console.log(`\u2502 ${id} \u2502 ${queue} \u2502 ${failedAt} \u2502 ${exception} \u2502`)}console.log("\u2514\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518");console.log(`
|
|
2
|
+
`);let failedJobs;if(queueName)failedJobs=await FailedJob.where("queue",queueName).get();else failedJobs=await FailedJob.all();if(sinceCutoff)failedJobs=failedJobs.filter((j)=>{if(!j.failed_at)return!1;const ts=Date.parse(j.failed_at);return Number.isFinite(ts)&&ts>=sinceCutoff});if(failedJobs.length===0){if(sinceCutoff)console.log(`\u2713 No failed jobs found since ${sinceArg}`);else console.log("\u2713 No failed jobs found");process.exit(0)}console.log("\u250C\u2500\u2500\u2500\u2500\u2500\u252C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u252C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u252C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510");console.log("\u2502 ID \u2502 Queue \u2502 Failed At \u2502 Exception \u2502");console.log("\u251C\u2500\u2500\u2500\u2500\u2500\u253C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2524");for(const job of failedJobs){const id=String(job.id).padEnd(3),queue=(job.queue||"default").substring(0,48).padEnd(48),failedAt=String(job.failed_at||"N/A").substring(0,21).padEnd(21),exception=String(job.exception||"Unknown error").substring(0,31).padEnd(31);console.log(`\u2502 ${id} \u2502 ${queue} \u2502 ${failedAt} \u2502 ${exception} \u2502`)}console.log("\u2514\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518");console.log(`
|
|
3
3
|
Total: ${failedJobs.length} failed job(s)`);process.exit(0)}catch(error){const message=error instanceof Error?error.message:String(error);if(/no such table:\s*(?:jobs|failed_jobs)\b/i.test(message)){process.stdout.write(`Queue tables are not set up yet.
|
|
4
4
|
`);process.stdout.write("Run `buddy queue:table` to create the migrations, then `buddy migrate` to apply them.\n");process.exit(0)}await log.error("Failed to fetch failed jobs",error);process.exit(1)}function parseArgs(){const args={};process.argv.forEach((arg)=>{if(arg.startsWith("--")){const[key,value]=arg.slice(2).split("=");if(key&&value)args[key]=value}});return args}function parseSinceDuration(input){const m=/^(\d+)([smhd])$/.exec(input.trim());if(!m)return null;const n=Number(m[1]);if(!Number.isFinite(n)||n<=0)return null;const mult=m[2]==="s"?1000:m[2]==="m"?60000:m[2]==="h"?3600000:86400000;return Date.now()-n*mult}
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@stacksjs/actions",
|
|
3
3
|
"type": "module",
|
|
4
4
|
"sideEffects": false,
|
|
5
|
-
"version": "0.74.
|
|
5
|
+
"version": "0.74.64",
|
|
6
6
|
"description": "The Stacks actions.",
|
|
7
7
|
"author": "Chris Breuer",
|
|
8
8
|
"contributors": [
|
|
@@ -60,53 +60,53 @@
|
|
|
60
60
|
"prepublishOnly": "bun run build"
|
|
61
61
|
},
|
|
62
62
|
"dependencies": {
|
|
63
|
-
"@stacksjs/action-runner": "0.74.
|
|
64
|
-
"@stacksjs/ai": "0.74.
|
|
65
|
-
"@stacksjs/analytics": "0.74.
|
|
66
|
-
"@stacksjs/api": "0.74.
|
|
67
|
-
"@stacksjs/auth": "0.74.
|
|
68
|
-
"@stacksjs/build": "0.74.
|
|
63
|
+
"@stacksjs/action-runner": "0.74.64",
|
|
64
|
+
"@stacksjs/ai": "0.74.64",
|
|
65
|
+
"@stacksjs/analytics": "0.74.64",
|
|
66
|
+
"@stacksjs/api": "0.74.64",
|
|
67
|
+
"@stacksjs/auth": "0.74.64",
|
|
68
|
+
"@stacksjs/build": "0.74.64",
|
|
69
69
|
"@stacksjs/bumpx": "^0.2.6",
|
|
70
70
|
"@stacksjs/bunpress": "^0.2.8",
|
|
71
|
-
"@stacksjs/cli": "0.74.
|
|
72
|
-
"@stacksjs/cloud": "0.74.
|
|
73
|
-
"@stacksjs/cms": "0.74.
|
|
74
|
-
"@stacksjs/components": "^0.2.
|
|
75
|
-
"@stacksjs/config": "0.74.
|
|
76
|
-
"@stacksjs/database": "0.74.
|
|
77
|
-
"@stacksjs/desktop-build": "0.74.
|
|
78
|
-
"@stacksjs/dns": "0.74.
|
|
79
|
-
"@stacksjs/enums": "0.74.
|
|
80
|
-
"@stacksjs/env": "0.74.
|
|
81
|
-
"@stacksjs/error-handling": "0.74.
|
|
71
|
+
"@stacksjs/cli": "0.74.64",
|
|
72
|
+
"@stacksjs/cloud": "0.74.64",
|
|
73
|
+
"@stacksjs/cms": "0.74.64",
|
|
74
|
+
"@stacksjs/components": "^0.2.304",
|
|
75
|
+
"@stacksjs/config": "0.74.64",
|
|
76
|
+
"@stacksjs/database": "0.74.64",
|
|
77
|
+
"@stacksjs/desktop-build": "0.74.64",
|
|
78
|
+
"@stacksjs/dns": "0.74.64",
|
|
79
|
+
"@stacksjs/enums": "0.74.64",
|
|
80
|
+
"@stacksjs/env": "0.74.64",
|
|
81
|
+
"@stacksjs/error-handling": "0.74.64",
|
|
82
82
|
"@stacksjs/gitit": "^0.2.5",
|
|
83
|
-
"@stacksjs/i18n": "0.74.
|
|
84
|
-
"@stacksjs/image": "0.74.
|
|
85
|
-
"@stacksjs/logging": "0.74.
|
|
83
|
+
"@stacksjs/i18n": "0.74.64",
|
|
84
|
+
"@stacksjs/image": "0.74.64",
|
|
85
|
+
"@stacksjs/logging": "0.74.64",
|
|
86
86
|
"@stacksjs/logsmith": "^0.2.3",
|
|
87
|
-
"@stacksjs/orm": "0.74.
|
|
88
|
-
"@stacksjs/path": "0.74.
|
|
89
|
-
"@stacksjs/payments": "0.74.
|
|
90
|
-
"@stacksjs/queue": "0.74.
|
|
91
|
-
"@stacksjs/registry": "0.74.
|
|
92
|
-
"@stacksjs/router": "0.74.
|
|
87
|
+
"@stacksjs/orm": "0.74.64",
|
|
88
|
+
"@stacksjs/path": "0.74.64",
|
|
89
|
+
"@stacksjs/payments": "0.74.64",
|
|
90
|
+
"@stacksjs/queue": "0.74.64",
|
|
91
|
+
"@stacksjs/registry": "0.74.64",
|
|
92
|
+
"@stacksjs/router": "0.74.64",
|
|
93
93
|
"@stacksjs/rpx": "^0.11.54",
|
|
94
|
-
"@stacksjs/scheduler": "0.74.
|
|
95
|
-
"@stacksjs/search-engine": "0.74.
|
|
96
|
-
"@stacksjs/security": "0.74.
|
|
97
|
-
"@stacksjs/server": "0.74.
|
|
98
|
-
"@stacksjs/sites": "0.74.
|
|
99
|
-
"@stacksjs/storage": "0.74.
|
|
100
|
-
"@stacksjs/strings": "0.74.
|
|
101
|
-
"@stacksjs/stx": "^0.2.
|
|
94
|
+
"@stacksjs/scheduler": "0.74.64",
|
|
95
|
+
"@stacksjs/search-engine": "0.74.64",
|
|
96
|
+
"@stacksjs/security": "0.74.64",
|
|
97
|
+
"@stacksjs/server": "0.74.64",
|
|
98
|
+
"@stacksjs/sites": "0.74.64",
|
|
99
|
+
"@stacksjs/storage": "0.74.64",
|
|
100
|
+
"@stacksjs/strings": "0.74.64",
|
|
101
|
+
"@stacksjs/stx": "^0.2.304",
|
|
102
102
|
"@stacksjs/tlsx": "^0.13.19",
|
|
103
103
|
"@stacksjs/ts-cloud": "^0.16.0",
|
|
104
104
|
"@stacksjs/ts-md": "^0.1.1",
|
|
105
|
-
"@stacksjs/tunnel": "0.74.
|
|
106
|
-
"@stacksjs/types": "0.74.
|
|
107
|
-
"@stacksjs/utils": "0.74.
|
|
108
|
-
"@stacksjs/whois": "0.74.
|
|
109
|
-
"bun-plugin-stx": "^0.2.
|
|
105
|
+
"@stacksjs/tunnel": "0.74.64",
|
|
106
|
+
"@stacksjs/types": "0.74.64",
|
|
107
|
+
"@stacksjs/utils": "0.74.64",
|
|
108
|
+
"@stacksjs/whois": "0.74.64",
|
|
109
|
+
"bun-plugin-stx": "^0.2.304"
|
|
110
110
|
},
|
|
111
111
|
"peerDependencies": {
|
|
112
112
|
"craft-native": ">=0.0.72",
|
|
@@ -121,7 +121,7 @@
|
|
|
121
121
|
}
|
|
122
122
|
},
|
|
123
123
|
"devDependencies": {
|
|
124
|
-
"@stacksjs/validation": "0.74.
|
|
124
|
+
"@stacksjs/validation": "0.74.64",
|
|
125
125
|
"better-dx": "^0.2.24"
|
|
126
126
|
}
|
|
127
127
|
}
|