mirror of
https://github.com/wassname/talk.git
synced 2026-07-11 22:01:26 +08:00
745c579b82
- Added new WEBPACK env var which is enabled during yarn build scripts - Defered redis starting until listen is called - Moved pubsub to a factory pattern init - Async/Await'ed the routes - Moved pubsub handle for routes into middleware - Adjusted redis cache and job processors to have lazy connection starting - Disabled mongo from auto-connecting on require - Adjusted package redis clients to act as factory singletons instead
15 lines
278 B
JavaScript
15 lines
278 B
JavaScript
const {RedisPubSub} = require('graphql-redis-subscriptions');
|
|
|
|
const {connectionOptions} = require('./redis');
|
|
|
|
let pubsub = null;
|
|
module.exports = () => {
|
|
if (pubsub) {
|
|
return pubsub;
|
|
}
|
|
|
|
pubsub = new RedisPubSub({connection: connectionOptions});
|
|
|
|
return pubsub;
|
|
};
|