Prevent unnecessary user-id update

This commit is contained in:
Douglas Barone 2020-12-09 08:30:17 -04:00
parent 1f7e8724da
commit 12db9c49b2

View File

@ -16,7 +16,10 @@ cron.schedule('*/1 * * * *', async () => {
logMsg('updateDevicesInfo started.') logMsg('updateDevicesInfo started.')
const devices = await updateDevicesInfo() const devices = await updateDevicesInfo()
const mappings = await updateUserIdMappings()
let mappings = null
if (devices > 0) mappings = await updateUserIdMappings()
logMsg( logMsg(
`updateDevicesInfo updated ${devices} devices and ${mappings} user-id mappings.` `updateDevicesInfo updated ${devices} devices and ${mappings} user-id mappings.`