summaryrefslogtreecommitdiff
path: root/cMain.c
diff options
context:
space:
mode:
authorDave Hibberd <hibby@debian.org>2024-11-30 21:42:45 +0000
committerDave Hibberd <hibby@debian.org>2024-11-30 21:42:45 +0000
commit3a600bee231fc20c7a71bcc78465a28447ac1bb4 (patch)
tree9b1a58a5069afbd52a1044537ce29483c21934f0 /cMain.c
parentd09a1686084e26be230cbddc38a2b4f435975041 (diff)
parentd1c36fce6e52b94d2df9c0eb969c1d72947d1284 (diff)
Update upstream source from tag 'upstream/6.0.24.52+repack'
Update to upstream version '6.0.24.52+repack' with Debian dir 0b34b91ce1e12fbb6ea021c31ba7daa6c49e3c49
Diffstat (limited to 'cMain.c')
-rw-r--r--cMain.c17
1 files changed, 15 insertions, 2 deletions
diff --git a/cMain.c b/cMain.c
index b63a69c..4f9dc9b 100644
--- a/cMain.c
+++ b/cMain.c
@@ -50,6 +50,7 @@ VOID SendSmartID(struct PORTCONTROL * PORT);
int CanPortDigi(int Port);
int KissEncode(UCHAR * inbuff, UCHAR * outbuff, int len);
void MQTTTimer();
+void SaveMH();
#include "configstructs.h"
@@ -1507,7 +1508,7 @@ BOOL Start()
upnpInit();
- CurrentSecs = lastSlowSecs = time(NULL);
+ lastSaveSecs = CurrentSecs = lastSlowSecs = time(NULL);
return 0;
}
@@ -2105,7 +2106,19 @@ VOID TIMERINTERRUPT()
}
*/
}
-
+
+ // Check Autosave Nodes and MH timer
+
+ if (CurrentSecs - lastSaveSecs >= 3600) // 1 per hour
+ {
+ lastSaveSecs = CurrentSecs;
+
+ if (AUTOSAVE == 1)
+ SaveNodes();
+ if (AUTOSAVEMH == 1)
+ SaveMH();
+ }
+
if (L4TIMERFLAG >= 10) // 1 PER SEC
{
L4TIMERFLAG -= 10;