Skip to content

Commit e79a033

Browse files
committed
Add delAll adapter imlpementation
1 parent ef5f0da commit e79a033

File tree

2 files changed

+23
-2986
lines changed

2 files changed

+23
-2986
lines changed

lib/index.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import uid2 = require("uid2");
22
import msgpack = require("notepack.io");
3-
import { Adapter, BroadcastOptions, Room } from "socket.io-adapter";
3+
import { Adapter, BroadcastOptions, Room, SocketId } from "socket.io-adapter";
44
import { PUBSUB } from "./util";
55

66
const debug = require("debug")("socket.io-redis");
@@ -941,6 +941,12 @@ export class RedisAdapter extends Adapter {
941941
this.pubClient.off("error", this.friendlyErrorHandler);
942942
this.subClient.off("error", this.friendlyErrorHandler);
943943
}
944+
delAll(id: SocketId) {
945+
// Call general adapter cleanup
946+
super.delAll(id);
947+
// Unsubscribe from Redis topics
948+
this.close();
949+
}
944950
}
945951

946952
export { createShardedAdapter } from "./sharded-adapter";

0 commit comments

Comments
 (0)