()
| 95 | if (this._isReady) return resolve(this._isReady); |
| 96 | |
| 97 | const getEventPromise = () => { |
| 98 | if (this.settings.getEvents || this.settings.activateDelayedJobs) { |
| 99 | return this.makeClient('eclient', true).then(() => { |
| 100 | this.eclient.on('message', this._onMessage.bind(this)); |
| 101 | const channels = []; |
| 102 | if (this.settings.getEvents) { |
| 103 | channels.push(this.toKey('events')); |
| 104 | } |
| 105 | if (this.settings.activateDelayedJobs) { |
| 106 | channels.push(this.toKey('earlierDelayed')); |
| 107 | } |
| 108 | return Promise.all( |
| 109 | channels.map((channel) => |
| 110 | helpers.callAsync((done) => |
| 111 | this.eclient.subscribe(channel, done) |
| 112 | ) |
| 113 | ) |
| 114 | ); |
| 115 | }); |
| 116 | } |
| 117 | |
| 118 | return null; |
| 119 | }; |
| 120 | |
| 121 | const eventsPromise = getEventPromise(); |
| 122 | // Wait for Lua scripts and client connections to load. Also wait for |
nothing calls this directly
no test coverage detected