diff options
| author | Dave Hibberd <hibby@debian.org> | 2024-11-28 22:33:53 +0000 |
|---|---|---|
| committer | Dave Hibberd <hibby@debian.org> | 2024-11-28 22:33:53 +0000 |
| commit | e2a62732f504cca5db8fb8d6d38ca64dfd4b92ac (patch) | |
| tree | e757406df9b2efba5890c70b237d2d91380f1c89 /cMain.c | |
| parent | 7d1deaae3884a9ca8bdba9df5c7b317171ab3b40 (diff) | |
New upstream version 6.0.24.51upstream/6.0.24.51
Diffstat (limited to 'cMain.c')
| -rw-r--r-- | cMain.c | 17 |
1 files changed, 15 insertions, 2 deletions
@@ -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;
|
