@hotmeshio/hotmesh 0.3.0 → 0.3.1

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.
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hotmeshio/hotmesh",
3
- "version": "0.3.0",
3
+ "version": "0.3.1",
4
4
  "description": "Unbreakable Workflows",
5
5
  "main": "./build/index.js",
6
6
  "types": "./build/index.d.ts",
@@ -44,6 +44,7 @@ class Activity {
44
44
  collator_1.CollatorService.assertJobActive(this.context.metadata.js, this.context.metadata.jid, this.metadata.aid, threshold);
45
45
  }
46
46
  catch (error) {
47
+ await collator_1.CollatorService.notarizeEntry(this);
47
48
  if (threshold > 0) {
48
49
  if (this.context.metadata.js === threshold) {
49
50
  const status = await this.setStatus(-threshold);
@@ -55,6 +56,7 @@ class Activity {
55
56
  else {
56
57
  throw error;
57
58
  }
59
+ return;
58
60
  }
59
61
  await collator_1.CollatorService.notarizeEntry(this);
60
62
  }
@@ -104,7 +106,7 @@ class Activity {
104
106
  }
105
107
  catch (error) {
106
108
  if (error instanceof errors_1.CollationError) {
107
- this.logger.info('process-event-inactive-error', { ...error });
109
+ this.logger.info(`process-event-${error.fault}-error`, { ...error });
108
110
  return;
109
111
  }
110
112
  else if (error instanceof errors_1.InactiveJobError) {
@@ -51,6 +51,16 @@ class Await extends activity_1.Activity {
51
51
  this.logger.error('await-get-state-error', { ...error });
52
52
  return;
53
53
  }
54
+ else if (error instanceof errors_1.CollationError) {
55
+ if (error.fault === 'duplicate') {
56
+ this.logger.info('await-collation-overage', {
57
+ job_id: this.context.metadata.jid,
58
+ guid: this.context.metadata.guid,
59
+ });
60
+ return;
61
+ }
62
+ this.logger.error('await-collation-error', { ...error });
63
+ }
54
64
  else {
55
65
  this.logger.error('await-process-error', { ...error });
56
66
  }
@@ -51,6 +51,16 @@ class Cycle extends activity_1.Activity {
51
51
  this.logger.error('cycle-get-state-error', { ...error });
52
52
  return;
53
53
  }
54
+ else if (error instanceof errors_1.CollationError) {
55
+ if (error.fault === 'duplicate') {
56
+ this.logger.info('cycle-collation-overage', {
57
+ job_id: this.context.metadata.jid,
58
+ guid: this.context.metadata.guid,
59
+ });
60
+ return;
61
+ }
62
+ this.logger.error('cycle-collation-error', { ...error });
63
+ }
54
64
  else {
55
65
  this.logger.error('cycle-process-error', { ...error });
56
66
  }
@@ -45,6 +45,16 @@ class Hook extends activity_1.Activity {
45
45
  this.logger.error('hook-get-state-error', { ...error });
46
46
  return;
47
47
  }
48
+ else if (error instanceof errors_1.CollationError) {
49
+ if (error.fault === 'duplicate') {
50
+ this.logger.info('hook-collation-overage', {
51
+ job_id: this.context.metadata.jid,
52
+ guid: this.context.metadata.guid,
53
+ });
54
+ return;
55
+ }
56
+ this.logger.error('hook-collation-error', { ...error });
57
+ }
48
58
  else {
49
59
  this.logger.error('hook-process-error', { ...error });
50
60
  }
@@ -41,6 +41,16 @@ class Interrupt extends activity_1.Activity {
41
41
  this.logger.error('interrupt-get-state-error', { ...error });
42
42
  return;
43
43
  }
44
+ else if (error instanceof errors_1.CollationError) {
45
+ if (error.fault === 'duplicate') {
46
+ this.logger.info('interrupt-collation-overage', {
47
+ job_id: this.context.metadata.jid,
48
+ guid: this.context.metadata.guid,
49
+ });
50
+ return;
51
+ }
52
+ this.logger.error('interrupt-collation-error', { ...error });
53
+ }
44
54
  else {
45
55
  this.logger.error('interrupt-process-error', { ...error });
46
56
  }
@@ -59,6 +59,16 @@ class Signal extends activity_1.Activity {
59
59
  this.logger.error('signal-get-state-error', { ...error });
60
60
  return;
61
61
  }
62
+ else if (error instanceof errors_1.CollationError) {
63
+ if (error.fault === 'duplicate') {
64
+ this.logger.info('signal-collation-overage', {
65
+ job_id: this.context.metadata.jid,
66
+ guid: this.context.metadata.guid,
67
+ });
68
+ return;
69
+ }
70
+ this.logger.error('signal-collation-error', { ...error });
71
+ }
62
72
  else {
63
73
  this.logger.error('signal-process-error', { ...error });
64
74
  }
@@ -56,7 +56,7 @@ class Trigger extends activity_1.Activity {
56
56
  if (error instanceof errors_1.DuplicateJobError) {
57
57
  const isOverage = await collator_1.CollatorService.isInceptionOverage(this, this.context.metadata.guid);
58
58
  if (isOverage) {
59
- this.logger.info('duplicate-job-overage', {
59
+ this.logger.info('trigger-collation-overage', {
60
60
  job_id: error.jobId,
61
61
  guid: this.context.metadata.guid,
62
62
  });
@@ -50,6 +50,16 @@ class Worker extends activity_1.Activity {
50
50
  this.logger.error('worker-get-state-error', { ...error });
51
51
  return;
52
52
  }
53
+ else if (error instanceof errors_1.CollationError) {
54
+ if (error.fault === 'duplicate') {
55
+ this.logger.info('worker-collation-overage', {
56
+ job_id: this.context.metadata.jid,
57
+ guid: this.context.metadata.guid,
58
+ });
59
+ return;
60
+ }
61
+ this.logger.error('worker-collation-error', { ...error });
62
+ }
53
63
  else {
54
64
  this.logger.error('worker-process-error', { ...error });
55
65
  }
@@ -237,7 +237,7 @@ class WorkerService {
237
237
  isProcessing = true;
238
238
  const workflowInput = data.data;
239
239
  const execIndex = counter.counter - interruptionRegistry.length + 1;
240
- const { workflowId, workflowTopic, workflowDimension, originJobId } = workflowInput;
240
+ const { workflowId, workflowTopic, workflowDimension, originJobId, expire } = workflowInput;
241
241
  const collatorFlowId = `${(0, utils_1.guid)()}$C`;
242
242
  return {
243
243
  status: stream_1.StreamStatus.SUCCESS,
@@ -253,6 +253,7 @@ class WorkerService {
253
253
  parentWorkflowId: workflowId,
254
254
  workflowId: collatorFlowId,
255
255
  workflowTopic: workflowTopic,
256
+ expire,
256
257
  },
257
258
  };
258
259
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hotmeshio/hotmesh",
3
- "version": "0.3.0",
3
+ "version": "0.3.1",
4
4
  "description": "Unbreakable Workflows",
5
5
  "main": "./build/index.js",
6
6
  "types": "./build/index.d.ts",