@vulkano/core 1.15.4 → 1.15.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bootstrap/server.js +9 -12
- package/package.json +1 -1
package/bootstrap/server.js
CHANGED
|
@@ -733,10 +733,14 @@ module.exports = function loadServer() {
|
|
|
733
733
|
|
|
734
734
|
if ( String(adapter).toLocaleLowerCase() === 'redis') {
|
|
735
735
|
|
|
736
|
+
const {
|
|
737
|
+
socket: socketRedisConfig
|
|
738
|
+
} = redisAdapter || {};
|
|
739
|
+
|
|
736
740
|
const {
|
|
737
741
|
host,
|
|
738
742
|
port
|
|
739
|
-
} = redisAdapter || {};
|
|
743
|
+
} = socketRedisConfig || redisAdapter || {};
|
|
740
744
|
|
|
741
745
|
if (!host || !port) {
|
|
742
746
|
throw new Error('Unable to connect to Redis. File: "app/config/sockets/adapters/redis.js" to connect the sockets');
|
|
@@ -762,16 +766,9 @@ module.exports = function loadServer() {
|
|
|
762
766
|
|
|
763
767
|
if ( String(adapter).toLocaleLowerCase() === 'redis') {
|
|
764
768
|
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
port: redisAdapter.port
|
|
768
|
-
};
|
|
769
|
-
|
|
770
|
-
if (redisAdapter.password) {
|
|
771
|
-
propsToRedis.password = redisAdapter.password;
|
|
772
|
-
}
|
|
769
|
+
pubClient = socketRedis(redisAdapter);
|
|
770
|
+
pubClient.on('error', (err) => console.log('Socket Redis Client Error', err));
|
|
773
771
|
|
|
774
|
-
pubClient = socketRedis(propsToRedis);
|
|
775
772
|
subClient = pubClient.duplicate();
|
|
776
773
|
|
|
777
774
|
io.adapter(socketRedisAdapter(pubClient, subClient));
|
|
@@ -842,8 +839,8 @@ module.exports = function loadServer() {
|
|
|
842
839
|
|
|
843
840
|
Promise
|
|
844
841
|
.all([
|
|
845
|
-
(
|
|
846
|
-
(
|
|
842
|
+
(pubClient ? pubClient.connect() : null),
|
|
843
|
+
(subClient ? subClient.connect() : null)
|
|
847
844
|
])
|
|
848
845
|
.then(() => {
|
|
849
846
|
|