FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

fix: misc edge case fixes · bee-queue/bee-queue@a2df983 · GitHub

Commit a2df983

Browse files
authored
fix: misc edge case fixes
Fixes: - produce uncaught exceptions instead of unhandled rejections - invoke `Queue#close` callback in edge case - improve error reporting from `Queue#close` - emit `error` events from `Queue` when un-stall command fails - fix checkStalledJobs error handling - make checkStalledJobs to recurse even after a failure - prevent errant uncaught exceptions due to errors early in client connection Codebase quality: - add prettier - add eslint rules - improve testing, fix some race conditions - upgrade outdated modules - use callAsync over long-form deferred - some refactoring
1 parent f63ddf0 commit a2df983

36 files changed

Lines changed: 2758 additions & 2616 deletions

‎.dependabot/config.yml‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
version: 1
22
update_configs:
3-
- package_manager: "javascript"
4-
directory: "/"
5-
update_schedule: "live"
6-
version_requirement_updates: "widen_ranges"
3+
- package_manager: 'javascript'
4+
directory: '/'
5+
update_schedule: 'live'
6+
version_requirement_updates: 'widen_ranges'
77
commit_message:
8-
prefix: "chore"
8+
prefix: 'chore'
99
include_scope: true

‎.eslintignore‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/coverage

‎.eslintrc.json‎

Lines changed: 69 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -3,51 +3,76 @@
33
"node": true,
44
"es6": true
55
},
6-
"overrides": [{
7-
"files": ["benchmark/**", "examples/**"],
8-
"rules": {
9-
"no-console": "off"
6+
"extends": ["plugin:prettier/recommended"],
7+
"overrides": [
8+
{
9+
"files": ["lib/**"],
10+
"rules": {
11+
"max-len": "error"
12+
}
13+
},
14+
{
15+
"files": ["benchmark/**", "examples/**"],
16+
"rules": {
17+
"no-console": "off"
18+
}
19+
},
20+
{
21+
"files": ["test/**"],
22+
"parserOptions": {
23+
"ecmaVersion": 2017,
24+
"sourceType": "module"
25+
},
26+
"rules": {
27+
"handle-callback-err": "warn",
28+
"no-shadow": "off",
29+
"no-warning-comments": "off"
30+
}
1031
}
11-
}],
32+
],
1233
"rules": {
13-
"array-bracket-spacing": [2, "never"],
14-
"brace-style": [2, "1tbs"],
15-
"camelcase": 2,
16-
"comma-style": [2, "last"],
17-
"computed-property-spacing": [2, "never"],
18-
"consistent-this": [2, "self"],
19-
"curly": [1, "multi-line"],
20-
"dot-notation": 2,
21-
"eol-last": 2,
22-
"eqeqeq": [2, "smart"],
23-
"indent": [2, 2, {"SwitchCase": 1, "VariableDeclarator": { "var": 2, "let": 2, "const": 3}}],
24-
"key-spacing": 1,
25-
"new-cap": [2, {"capIsNew": false}],
26-
"no-console": 2,
27-
"no-extra-parens": 1,
28-
"no-floating-decimal": 2,
29-
"no-inner-declarations": 2,
30-
"no-mixed-spaces-and-tabs": 2,
31-
"no-multiple-empty-lines": [2, {"max": 2}],
32-
"no-redeclare": 2,
33-
"no-shadow": 1,
34-
"no-spaced-func": 2,
35-
"no-trailing-spaces": 2,
36-
"no-undef": 2,
37-
"no-underscore-dangle": 0,
38-
"no-unused-vars": [2, {"vars": "all", "args": "after-used"}],
39-
"no-use-before-define": [2, "nofunc"],
40-
"no-var": 2,
41-
"no-warning-comments": [1, {"terms": ["todo"], "location": "anywhere"}],
42-
"object-curly-spacing": [2, "never"],
43-
"quotes": [2, "single"],
44-
"semi": [2, "always"],
45-
"semi-spacing": [2, {"before": false, "after": true}],
46-
"keyword-spacing": 2,
47-
"space-before-blocks": 2,
48-
"space-before-function-paren": [2, {"anonymous": "always", "named": "never"}],
49-
"space-in-parens": 2,
50-
"space-infix-ops": 2,
51-
"strict": 0
34+
"array-bracket-spacing": ["error", "never"],
35+
"brace-style": ["error", "1tbs"],
36+
"camelcase": "error",
37+
"comma-style": ["error", "last"],
38+
"computed-property-spacing": ["error", "never"],
39+
"consistent-this": ["error", "self"],
40+
"curly": ["warn", "multi-line"],
41+
"dot-notation": "error",
42+
"eol-last": "error",
43+
"eqeqeq": ["error", "smart"],
44+
"key-spacing": "warn",
45+
"new-cap": ["error", {"capIsNew": false}],
46+
"no-console": "error",
47+
"no-floating-decimal": "error",
48+
"no-inner-declarations": "error",
49+
"no-mixed-spaces-and-tabs": "error",
50+
"no-redeclare": "error",
51+
"no-shadow": "warn",
52+
"no-spaced-func": "error",
53+
"no-trailing-spaces": "error",
54+
"no-undef": "error",
55+
"no-underscore-dangle": "off",
56+
"no-unused-vars": ["error", {"vars": "all", "args": "after-used"}],
57+
"no-use-before-define": ["error", "nofunc"],
58+
"no-var": "error",
59+
"no-warning-comments": [
60+
"warn",
61+
{"terms": ["todo"], "location": "anywhere"}
62+
],
63+
"object-curly-spacing": ["error", "never"],
64+
"prefer-const": ["error", {"destructuring": "all"}],
65+
"quotes": ["error", "single"],
66+
"semi": ["error", "always"],
67+
"semi-spacing": ["error", {"before": false, "after": true}],
68+
"keyword-spacing": "error",
69+
"space-before-blocks": "error",
70+
"space-before-function-paren": [
71+
"error",
72+
{"anonymous": "always", "named": "never"}
73+
],
74+
"space-in-parens": "error",
75+
"space-infix-ops": "error",
76+
"strict": "off"
5277
}
5378
}

‎.prettierignore‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
/benchmark/results-*
2+
/coverage

‎.prettierrc‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"tabWidth": 2,
3+
"useTabs": false,
4+
"semi": true,
5+
"singleQuote": true,
6+
"trailingComma": "es5",
7+
"bracketSpacing": false,
8+
"arrowParens": "always",
9+
"endOfLine": "lf"
10+
}

‎.travis.yml‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,14 @@ node_js:
44
- 8
55
- 10
66
- node
7+
8+
git:
9+
autocrlf: input
10+
711
services: redis
12+
install: npm ci || (nvm i --lts --latest-npm && npm ci; nvm use "$TRAVIS_NODE_VERSION")
813
# this runs eslint, runs the tests, instruments their coverage, and
914
# publishes it to coveralls.io
10-
install: npm ci || (nvm i --lts --latest-npm && npm ci; nvm use "$TRAVIS_NODE_VERSION")
1115
script: npm run ci
1216
after_script:
1317
- redis-cli script flush

‎HISTORY.md‎

Lines changed: 33 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -1,59 +1,50 @@
1-
1.2.3 / 2020-01-28
2-
==================
1+
# 1.2.3 / 2020-01-28
32

4-
* Allow arbitrary values for progress (#109).
5-
* Fix cleanup of event redis client (#178).
6-
* Fix bluebird warning spam (#85).
7-
* Update Typescript definition for `Queue#close` method (#180).
8-
* Remove Node 4, 6 from CI (#156, 223151c).
3+
- Allow arbitrary values for progress (#109).
4+
- Fix cleanup of event redis client (#178).
5+
- Fix bluebird warning spam (#85).
6+
- Update Typescript definition for `Queue#close` method (#180).
7+
- Remove Node 4, 6 from CI (#156, 223151c).
98

10-
1.2.2 / 2018-01-25
11-
==================
9+
# 1.2.2 / 2018-01-25
1210

13-
* Update Typescript type definitions (thanks @brickyang for #98).
11+
- Update Typescript type definitions (thanks @brickyang for #98).
1412

15-
1.2.1 / 2018-01-15
16-
==================
13+
# 1.2.1 / 2018-01-15
1714

18-
* Update Typescript type definitions (thanks @brickyang for #94).
15+
- Update Typescript type definitions (thanks @brickyang for #94).
1916

20-
1.2.0 / 2018-01-10
21-
==================
17+
# 1.2.0 / 2018-01-10
2218

23-
* Add Typescript type definitions (thanks @pbadenski for #80 and @martinwepner for #89).
19+
- Add Typescript type definitions (thanks @pbadenski for #80 and @martinwepner for #89).
2420

25-
1.1.0 / 2017-08-12
26-
==================
21+
# 1.1.0 / 2017-08-12
2722

28-
* Support sharing the redis command client between Queues.
29-
* Add documentation, add tests for expected behavior.
23+
- Support sharing the redis command client between Queues.
24+
- Add documentation, add tests for expected behavior.
3025

31-
1.0.0 / 2017-06-30
32-
==================
26+
# 1.0.0 / 2017-06-30
3327

34-
* Upgrade node-redis to 2.7.1
35-
Note that redis connection options now match the latest redis.
36-
* Implement delayed jobs
37-
* Implement fixed, exponential backoff strategies
38-
* Add promise support
39-
* Fix race conditions in tests
40-
* Add new performance settings
41-
* Emit stalled event for stalled jobs
42-
* Implement graceful shutdown
43-
* Support user-specified jobids (should be non-numeric)
44-
* Add timeout, stacktraces to job options
28+
- Upgrade node-redis to 2.7.1
29+
Note that redis connection options now match the latest redis.
30+
- Implement delayed jobs
31+
- Implement fixed, exponential backoff strategies
32+
- Add promise support
33+
- Fix race conditions in tests
34+
- Add new performance settings
35+
- Emit stalled event for stalled jobs
36+
- Implement graceful shutdown
37+
- Support user-specified jobids (should be non-numeric)
38+
- Add timeout, stacktraces to job options
4539

46-
0.3.0 / 2015-09-01
47-
==================
40+
# 0.3.0 / 2015-09-01
4841

49-
* Bump node-redis dependency to 1.0.0
42+
- Bump node-redis dependency to 1.0.0
5043

51-
0.2.0 / 2015-06-12
52-
==================
44+
# 0.2.0 / 2015-06-12
5345

54-
* Initial release
46+
- Initial release
5547

56-
0.1.0 / 2015-01-26
57-
==================
48+
# 0.1.0 / 2015-01-26
5849

59-
* Early development
50+
- Early development

0 commit comments

Comments
 (0)

Back | FazBrowse Home | New Git URL