Implemented simple queue structure
This commit is contained in:
@@ -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 }
|
||||
|
||||
Reference in New Issue
Block a user