mirror of
https://github.com/zerotier/ZeroTierOne.git
synced 2025-06-14 13:18:21 +00:00
Create periodic backup copies of controller.db in network controller from the main process itself to facilitate easier and safer backups of controller.db.
This commit is contained in:
@ -39,6 +39,7 @@
|
||||
#include "../node/Constants.hpp"
|
||||
#include "../node/NetworkController.hpp"
|
||||
#include "../node/Mutex.hpp"
|
||||
#include "../osdep/Thread.hpp"
|
||||
|
||||
// Number of in-memory last log entries to maintain per user
|
||||
#define ZT_SQLITENETWORKCONTROLLER_IN_MEMORY_LOG_SIZE 32
|
||||
@ -86,6 +87,10 @@ public:
|
||||
std::string &responseBody,
|
||||
std::string &responseContentType);
|
||||
|
||||
// threadMain() for backup thread -- do not call directly
|
||||
void threadMain()
|
||||
throw();
|
||||
|
||||
private:
|
||||
enum IpAssignmentType {
|
||||
// IP assignment is a static IP address
|
||||
@ -112,6 +117,8 @@ private:
|
||||
static void _circuitTestCallback(ZT_Node *node,ZT_CircuitTest *test,const ZT_CircuitTestReport *report);
|
||||
|
||||
Node *_node;
|
||||
Thread _backupThread;
|
||||
volatile bool _backupThreadRun;
|
||||
std::string _dbPath;
|
||||
std::string _circuitTestPath;
|
||||
std::string _instanceId;
|
||||
|
Reference in New Issue
Block a user