@autofleet/sequelize-utils 5.0.6 → 5.0.9

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/index.js CHANGED
@@ -47,6 +47,11 @@ exports.default = (sequelize) => {
47
47
  }
48
48
  return transactionWithRetry((transaction) => __awaiter(void 0, void 0, void 0, function* () {
49
49
  // https://github.com/nodejs/node/blob/e46c680bf2b211bbd52cf959ca17ee98c7f657f5/test/parallel/test-http-aborted.js#L9
50
+ if (req.aborted) {
51
+ log(abortErrorText);
52
+ yield transaction.rollback();
53
+ return null;
54
+ }
50
55
  req.on('aborted', () => __awaiter(void 0, void 0, void 0, function* () {
51
56
  log(abortErrorText);
52
57
  yield transaction.rollback();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@autofleet/sequelize-utils",
3
- "version": "5.0.6",
3
+ "version": "5.0.9",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {
@@ -23,13 +23,16 @@
23
23
  "devDependencies": {
24
24
  "@types/bluebird": "^3.5.36",
25
25
  "@types/debug": "^4.1.6",
26
+ "@types/express": "^4.17.13",
26
27
  "@types/jest": "^26.0.24",
27
28
  "@types/validator": "^13.6.3",
28
29
  "@typescript-eslint/eslint-plugin": "^4.28.3",
29
30
  "@typescript-eslint/parser": "^4.28.3",
31
+ "axios": "^0.26.1",
30
32
  "eslint": "^7.31.0",
31
33
  "eslint-config-airbnb-base": "^14.2.1",
32
34
  "eslint-plugin-import": "^2.23.4",
35
+ "express": "^4.17.3",
33
36
  "pg": "^8.6.0",
34
37
  "ts-jest": "^27.0.3",
35
38
  "ts-node": "^10.1.0",
package/src/index.ts CHANGED
@@ -39,6 +39,12 @@ export default (sequelize: Sequelize): {
39
39
  }
40
40
  return transactionWithRetry(async (transaction: Transaction) => {
41
41
  // https://github.com/nodejs/node/blob/e46c680bf2b211bbd52cf959ca17ee98c7f657f5/test/parallel/test-http-aborted.js#L9
42
+ if (req.aborted) {
43
+ log(abortErrorText);
44
+ await transaction.rollback();
45
+ return null;
46
+ }
47
+
42
48
  req.on('aborted', async () => {
43
49
  log(abortErrorText);
44
50
  await transaction.rollback();