qdone 2.0.31-alpha → 2.0.33-alpha

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.
@@ -117,7 +117,23 @@ class JobExecutor {
117
117
  }
118
118
  if (this.opt.verbose) {
119
119
  console.error(chalk_1.default.blue('Stats: '), { stats: this.stats, jobStatuses });
120
- console.error(chalk_1.default.blue('Running: '), this.jobs.filter(j => j.status === 'processing').map(({ qname, message }) => ({ qname, payload: message.Body })));
120
+ console.error(chalk_1.default.blue('Jobs: '));
121
+ for (const [qname, jobs] of this.jobsByQueue.entries()) {
122
+ if (jobs.size) {
123
+ const stats = {};
124
+ for (const job of jobs)
125
+ stats[job.status] = (stats[job.status] || 0) + 1;
126
+ console.error(chalk_1.default.blue(' queue:'), qname);
127
+ if (stats.running)
128
+ console.error(chalk_1.default.green(' running: '), stats.running);
129
+ if (stats.waiting)
130
+ console.error(chalk_1.default.yellow(' waiting: '), stats.waiting);
131
+ if (stats.deleting)
132
+ console.error(chalk_1.default.blue(' complete: '), stats.deleting);
133
+ if (stats.failed)
134
+ console.error(chalk_1.default.red(' failed: '), stats.failed);
135
+ }
136
+ }
121
137
  }
122
138
  // Extend in batches for each queue
123
139
  for (const qrl in jobsToExtendByQrl) {
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "qdone",
3
- "version": "2.0.31-alpha",
3
+ "version": "2.0.33-alpha",
4
4
  "lockfileVersion": 2,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "qdone",
9
- "version": "2.0.31-alpha",
9
+ "version": "2.0.33-alpha",
10
10
  "license": "MIT",
11
11
  "dependencies": {
12
12
  "@aws-sdk/client-cloudwatch": "3.465.0",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "qdone",
3
- "version": "2.0.31-alpha",
3
+ "version": "2.0.33-alpha",
4
4
  "description": "Language agnostic job queue for SQS",
5
5
  "type": "module",
6
6
  "main": "./index.js",
@@ -124,7 +124,18 @@ export class JobExecutor {
124
124
 
125
125
  if (this.opt.verbose) {
126
126
  console.error(chalk.blue('Stats: '), { stats: this.stats, jobStatuses })
127
- console.error(chalk.blue('Running: '), this.jobs.filter(j => j.status === 'processing').map(({ qname, message }) => ({ qname, payload: message.Body })))
127
+ console.error(chalk.blue('Jobs: '))
128
+ for (const [qname, jobs] of this.jobsByQueue.entries()) {
129
+ if (jobs.size) {
130
+ const stats = {}
131
+ for (const job of jobs) stats[job.status] = (stats[job.status] || 0) + 1
132
+ console.error(chalk.blue(' queue:'), qname)
133
+ if (stats.running) console.error(chalk.green(' running: '), stats.running)
134
+ if (stats.waiting) console.error(chalk.yellow(' waiting: '), stats.waiting)
135
+ if (stats.deleting) console.error(chalk.blue(' complete: '), stats.deleting)
136
+ if (stats.failed) console.error(chalk.red(' failed: '), stats.failed)
137
+ }
138
+ }
128
139
  }
129
140
 
130
141
  // Extend in batches for each queue