Page MenuHomePhabricator

D3870.diff
No OneTemporary

D3870.diff

diff --git a/keyserver/src/socket/redis.js b/keyserver/src/socket/redis.js
--- a/keyserver/src/socket/redis.js
+++ b/keyserver/src/socket/redis.js
@@ -31,10 +31,13 @@
})();
class RedisPublisher {
- pub: RedisClient;
+ client: ?RedisClient;
- constructor() {
- this.pub = redis.createClient(redisConfig);
+ get pub(): RedisClient {
+ if (!this.client) {
+ this.client = redis.createClient(redisConfig);
+ }
+ return this.client;
}
sendMessage(target: UpdateTarget, message: RedisMessage) {
@@ -49,7 +52,7 @@
}
end() {
- this.pub.unref();
+ this.client?.unref();
}
}
const publisher: RedisPublisher = new RedisPublisher();

File Metadata

Mime Type
text/plain
Expires
Mon, Nov 25, 10:38 AM (20 h, 46 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2579366
Default Alt Text
D3870.diff (676 B)

Event Timeline