summaryrefslogtreecommitdiff
path: root/cMain.c
diff options
context:
space:
mode:
authorDave Hibberd <hibby@debian.org>2024-11-28 22:34:01 +0000
committerDave Hibberd <hibby@debian.org>2024-11-28 22:34:01 +0000
commit5d8d8963ef3279f86bd26928b43ca58c27704867 (patch)
tree9fe9a224bd247020d186941173e373a0aed609f9 /cMain.c
parent96d6e87d127146b44fa79761de7cda1c3766add9 (diff)
parente2a62732f504cca5db8fb8d6d38ca64dfd4b92ac (diff)
Update upstream source from tag 'upstream/6.0.24.51'
Update to upstream version '6.0.24.51' with Debian dir b28e5722f66385b34f6117cf7c6dcf9d79e5cb62
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;