Implemented simple queue structure

This commit is contained in:
RemixDev
2021-05-13 18:14:38 +02:00
parent 7b16ddc91a
commit dbc1e2bcfb
7 changed files with 148 additions and 20 deletions

View File

@@ -1,7 +1,6 @@
import { Server as WsServer } from 'ws'
import { consoleInfo } from '../../helpers/errors'
import { saveSettings } from '../../main'
import { broadcast } from '../index'
import { saveSettings, listener } from '../../main'
const eventName = 'saveSettings'
@@ -9,7 +8,7 @@ const cb = (data: any, ws: any, wss: WsServer) => {
const {settings, spotifySettings} = data
saveSettings(settings)
consoleInfo('Settings saved')
broadcast(wss, 'updateSettings', {settings, spotifySettings})
listener.send('updateSettings', {settings, spotifySettings})
}
export default { eventName, cb }