bellboy 6.3.1 → 6.3.2
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/README.md
CHANGED
|
@@ -113,12 +113,12 @@ const job = new bellboy.Job(
|
|
|
113
113
|
|
|
114
114
|
#### Events and event listeners <div id='events'/>
|
|
115
115
|
|
|
116
|
-
Event listeners, which can be registered with `job.on` or `job.onAny`
|
|
116
|
+
Event listeners, which can be registered with `job.on` or `job.onAny` methods, allow you to listen to specific events in the job lifecycle and to interact with them.
|
|
117
117
|
|
|
118
118
|
- Multiple listeners for one event will be executed in the order they were registered.
|
|
119
|
-
- Job always waits code inside listener to complete.
|
|
120
|
-
- Any error thrown inside listener will be ignored and warning message will be printed out.
|
|
121
|
-
- `job.stop()` method can be used inside listener to stop job execution and throw an error if needed.
|
|
119
|
+
- Job always waits for the code inside a listener to complete.
|
|
120
|
+
- Any error thrown inside a listener will be ignored and warning message will be printed out.
|
|
121
|
+
- `job.stop()` method can be used inside a listener to stop job execution and throw an error if needed.
|
|
122
122
|
|
|
123
123
|
```ts
|
|
124
124
|
job.on(
|
|
@@ -126,7 +126,7 @@ var MssqlDestination = /** @class */ (function (_super) {
|
|
|
126
126
|
transaction = new sql.Transaction(db);
|
|
127
127
|
_c.label = 7;
|
|
128
128
|
case 7:
|
|
129
|
-
_c.trys.push([7, 11, ,
|
|
129
|
+
_c.trys.push([7, 11, , 15]);
|
|
130
130
|
return [4 /*yield*/, transaction.begin()];
|
|
131
131
|
case 8:
|
|
132
132
|
_c.sent();
|
|
@@ -136,18 +136,20 @@ var MssqlDestination = /** @class */ (function (_super) {
|
|
|
136
136
|
return [4 /*yield*/, transaction.commit()];
|
|
137
137
|
case 10:
|
|
138
138
|
_c.sent();
|
|
139
|
-
return [3 /*break*/,
|
|
139
|
+
return [3 /*break*/, 15];
|
|
140
140
|
case 11:
|
|
141
141
|
err_1 = _c.sent();
|
|
142
|
+
if (!!transaction._aborted) return [3 /*break*/, 13];
|
|
142
143
|
return [4 /*yield*/, transaction.rollback()];
|
|
143
144
|
case 12:
|
|
144
145
|
_c.sent();
|
|
145
|
-
|
|
146
|
-
case 13:
|
|
146
|
+
_c.label = 13;
|
|
147
|
+
case 13: return [4 /*yield*/, pool.close()];
|
|
148
|
+
case 14:
|
|
147
149
|
_c.sent();
|
|
148
150
|
throw err_1;
|
|
149
|
-
case
|
|
150
|
-
case
|
|
151
|
+
case 15: return [4 /*yield*/, pool.close()];
|
|
152
|
+
case 16:
|
|
151
153
|
_c.sent();
|
|
152
154
|
return [2 /*return*/];
|
|
153
155
|
}
|