Update:Cleanup socket usage & add func for emitting events to admin users

This commit is contained in:
advplyr 2022-11-24 16:35:26 -06:00
parent e2af33e136
commit 180293ebc1
7 changed files with 90 additions and 105 deletions

View file

@ -258,23 +258,6 @@ class Db {
})
}
updateUserStream(userId, streamId) {
return this.usersDb.update((record) => record.id === userId, (user) => {
user.stream = streamId
return user
}).then((results) => {
Logger.debug(`[DB] Updated user ${results.updated}`)
this.users = this.users.map(u => {
if (u.id === userId) {
u.stream = streamId
}
return u
})
}).catch((error) => {
Logger.error(`[DB] Update user Failed ${error}`)
})
}
updateServerSettings() {
global.ServerSettings = this.serverSettings.toJSON()
return this.updateEntity('settings', this.serverSettings)