Update forceUserDisconnect()

This commit is contained in:
Douglas Barone 2021-11-03 10:03:47 -04:00
parent c325312988
commit 1140ae502a

View File

@ -54,14 +54,22 @@ async function updateDevicesStatus() {
}
async function forceUserDisconnect(mac) {
await prisma.wifiDevice.update({
where: { mac },
data: {
user: {
disconnect: true
try {
await prisma.wifiDevice.update({
where: { mac },
data: {
user: {
disconnect: true
}
}
}
})
})
} catch (e) {
logError({
tags: ['wifiDevices'],
message: `Erro tentando desconectar o usuário do dispositivo "${mac}".`,
data: { error: e, mac }
})
}
}
function mockHostName({ mac, oui }) {