Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade ioredis to v.5 #103

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
node_modules
.vscode
.idea
dist
__pycache__
6,605 changes: 3,564 additions & 3,041 deletions package-lock.json

Large diffs are not rendered by default.

13 changes: 6 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "celery-node",
"version": "0.5.9",
"version": "0.5.10",
"description": "celery written in nodejs",
"main": "dist/index.js",
"types": "dist/index.d.ts",
Expand Down Expand Up @@ -36,14 +36,13 @@
"devDependencies": {
"@types/amqplib": "^0.5.17",
"@types/chai": "^4.2.9",
"@types/ioredis": "^4.28.5",
"@types/mocha": "^7.0.1",
"@types/sinon": "^9.0.9",
"@types/uuid": "^3.4.7",
"@typescript-eslint/eslint-plugin": "^2.23.0",
"@typescript-eslint/parser": "^2.23.0",
"@typescript-eslint/eslint-plugin": "^5.54.1",
"@typescript-eslint/parser": "^5.54.1",
"chai": "^4.2.0",
"eslint": "^7.16.0",
"eslint": "^7.32.0",
"eslint-config-prettier": "^7.1.0",
"eslint-plugin-import": "^2.22.1",
"eslint-plugin-mocha": "^8.0.0",
Expand All @@ -52,11 +51,11 @@
"prettier": "^1.19.1",
"sinon": "^7.2.2",
"ts-node": "^8.10.2",
"typescript": "^3.7.2"
"typescript": "^4.9.5"
},
"dependencies": {
"amqplib": "^0.8.0",
"ioredis": "^4.28.5",
"ioredis": "^5.3.1",
"uuid": "^3.3.2"
}
}
4 changes: 2 additions & 2 deletions src/backends/redis.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as Redis from "ioredis";
import Redis from "ioredis";
import { CeleryBackend } from ".";

/**
Expand All @@ -14,7 +14,7 @@ const keyPrefix = "celery-task-meta-";
* @exports
*/
export default class RedisBackend implements CeleryBackend {
redis: Redis.Redis;
redis: Redis;

/**
* Redis backend class
Expand Down
2 changes: 1 addition & 1 deletion src/kombu/brokers/amqp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export default class AMQPBroker implements CeleryBroker {
* @method AMQPBroker#isReady
* @returns {Promise} promises that continues if amqp connected.
*/
public isReady(): Promise<amqplib.Channel> {
public isReady(): Promise<void> {
return new Promise((resolve, reject) => {
this.channel.then(ch => {
Promise.all([
Expand Down
4 changes: 2 additions & 2 deletions src/kombu/brokers/redis.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as Redis from "ioredis";
import Redis from "ioredis";
import { v4 } from "uuid";
import { CeleryBroker } from ".";
import { Message } from "../message";
Expand All @@ -21,7 +21,7 @@ class RedisMessage extends Message {
}

export default class RedisBroker implements CeleryBroker {
redis: Redis.Redis;
redis: Redis;
channels = [];
closing = false;

Expand Down
4 changes: 2 additions & 2 deletions test/app/test_client.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { assert } from "chai";
import * as Redis from "ioredis";
import { Redis } from "ioredis";
import * as sinon from "sinon";
import Client from "../../src/app/client";
import Worker from "../../src/app/worker";
Expand Down Expand Up @@ -33,7 +33,7 @@ describe("celery functional tests", () => {
return worker.whenCurrentJobsFinished();
});

after(() => {
after(async () => {
Promise.all([client.disconnect(), worker.disconnect()]);

const redis = new Redis();
Expand Down
2 changes: 1 addition & 1 deletion test/app/test_result.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { assert } from "chai";
import { AsyncResult } from "../../src/app/result";
import RedisBackend from "../../src/backends/redis";
import * as sinon from "sinon";
import * as Redis from "ioredis";
import Redis from "ioredis";

describe("AsyncResult", () => {
const redisBackend = new RedisBackend("redis://localhost:6379/0", {});
Expand Down
2 changes: 1 addition & 1 deletion test/app/test_worker.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { assert } from "chai";
import * as Redis from "ioredis";
import Redis from "ioredis";
import Client from "../../src/app/client";
import Worker from "../../src/app/worker";
import { CeleryConf } from "../../src/app/conf";
Expand Down
2 changes: 1 addition & 1 deletion test/kombu/brokers/test_redis.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// import * as Redis from "ioredis";
// import Redis from "ioredis";
// import { assert } from "chai";
// import RedisBroker from "../../../src/kombu/brokers/redis";

Expand Down