Skip to content
This repository was archived by the owner on Apr 17, 2023. It is now read-only.

Commit 18294b4

Browse files
authored
chore: remove relics of the past (#85)
1 parent 6e4910d commit 18294b4

File tree

13 files changed

+5
-449
lines changed

13 files changed

+5
-449
lines changed

libs/gateway/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@
3131
"homepage": "https://github.com/cordis-lib/cordis#readme",
3232
"devDependencies": {
3333
"@types/common-tags": "^1.8.0",
34-
"@types/ioredis": "^4.26.3",
3534
"@types/node": "^14.14.44",
3635
"@types/ws": "^7.4.4",
3736
"erlpack": "github:discord/erlpack",

libs/gateway/src/websocket/Cluster.ts

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,14 @@ import {
77
WebsocketConnectionConnectOptions
88
} from './WebsocketConnection';
99
import { stripIndent } from 'common-tags';
10-
import { Rest, MemoryMutex, RedisMutex } from '@cordis/rest';
10+
import { Rest, MemoryMutex, Mutex } from '@cordis/rest';
1111
import {
1212
APIUser,
1313
GatewayDispatchPayload,
1414
GatewaySendPayload,
1515
RESTGetAPIGatewayBotResult,
1616
Routes
1717
} from 'discord-api-types/v8';
18-
import type { Redis } from 'ioredis';
1918

2019
/**
2120
* Options for creating a cluster
@@ -34,9 +33,9 @@ export interface ClusterOptions extends WebsocketConnectionOptions {
3433
*/
3534
totalShardCount?: number | 'auto';
3635
/**
37-
* Optional IORedis instance for cross-worker storage
36+
* Optional Mutex implementation to use for REST
3837
*/
39-
redis?: Redis;
38+
mutex?: Mutex;
4039
}
4140

4241
/* eslint-disable @typescript-eslint/unified-signatures */
@@ -182,11 +181,11 @@ export class Cluster extends EventEmitter {
182181
shardCount = 'auto',
183182
startingShard = 0,
184183
totalShardCount = shardCount,
185-
redis,
184+
mutex,
186185
...shardOptions
187186
} = options;
188187

189-
this.rest = new Rest(auth, { mutex: redis ? new RedisMutex(redis) : new MemoryMutex() });
188+
this.rest = new Rest(auth, { mutex: mutex ?? new MemoryMutex() });
190189
this.shardCount = shardCount;
191190
this.startingShard = startingShard;
192191
this.totalShardCount = totalShardCount;

libs/rest/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@
3333
"@types/node": "^14.14.44",
3434
"@types/node-fetch": "^2.5.10",
3535
"fetch-blob": "^2.1.2",
36-
"ioredis": "^4.27.2",
3736
"typescript": "^4.2.4"
3837
},
3938
"dependencies": {

libs/rest/src/index.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
export * from './mutex';
2-
export * from './routing';
32
export * from './struct';
43
export * from './Constants';
54
export * from './Error';

libs/rest/src/mutex/RedisMutex.ts

Lines changed: 0 additions & 70 deletions
This file was deleted.

libs/rest/src/mutex/index.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
11
export * from './MemoryMutex';
22
export * from './Mutex';
3-
export * from './RedisMutex';

libs/rest/src/routing/IRouter.ts

Lines changed: 0 additions & 9 deletions
This file was deleted.

libs/rest/src/routing/index.ts

Lines changed: 0 additions & 2 deletions
This file was deleted.

libs/rest/src/routing/restRouter.test.ts

Lines changed: 0 additions & 17 deletions
This file was deleted.

libs/rest/src/routing/restRouter.ts

Lines changed: 0 additions & 40 deletions
This file was deleted.

0 commit comments

Comments
 (0)