reset timeout

This commit is contained in:
seriousm4x
2023-08-14 20:39:39 +02:00
parent bccbb9420c
commit a55152250b
2 changed files with 2 additions and 1 deletions

View File

@@ -38,7 +38,7 @@ func RunPing(app *pocketbase.PocketBase) {
for _, device := range Devices {
// ping
go func(device *models.Record) {
oldStatus := device.Get("status")
oldStatus := device.GetString("status")
newStatus := networking.PingDevice(device)
if newStatus {
if oldStatus == "offline" || oldStatus == "" {

View File

@@ -63,6 +63,7 @@
}
function countdown() {
timeout = 120;
clearInterval(interval);
const end = Date.parse(device.updated) + 2 * 60 * 1000;
interval = setInterval(() => {