Fix considering unchanged network time as error

This commit is contained in:
Jonas Lochmann
2020-02-10 01:00:00 +01:00
parent 6fc9597d20
commit af17e6cc8e
@@ -1,6 +1,6 @@
/* /*
* server component for the TimeLimit App * server component for the TimeLimit App
* Copyright (C) 2019 Jonas Lochmann * Copyright (C) 2019 - 2020 Jonas Lochmann
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as * it under the terms of the GNU Affero General Public License as
@@ -22,7 +22,7 @@ export async function dispatchUpdateNetworkTimeVerification ({ action, cache }:
action: UpdateNetworkTimeVerificationAction action: UpdateNetworkTimeVerificationAction
cache: Cache cache: Cache
}) { }) {
const [affectedRows] = await cache.database.device.update({ await cache.database.device.update({
networkTime: action.mode networkTime: action.mode
}, { }, {
where: { where: {
@@ -32,10 +32,6 @@ export async function dispatchUpdateNetworkTimeVerification ({ action, cache }:
transaction: cache.transaction transaction: cache.transaction
}) })
if (affectedRows === 0) { cache.invalidiateDeviceList = true
throw new Error('invalid device id') cache.areChangesImportant = true
} else {
cache.invalidiateDeviceList = true
cache.areChangesImportant = true
}
} }