Page MenuHomePhorge

D14738.1768404825.diff
No OneTemporary

Size
1 KB
Referenced Files
None
Subscribers
None

D14738.1768404825.diff

diff --git a/native/cpp/CommonCpp/DatabaseManagers/DatabaseManager.cpp b/native/cpp/CommonCpp/DatabaseManagers/DatabaseManager.cpp
--- a/native/cpp/CommonCpp/DatabaseManagers/DatabaseManager.cpp
+++ b/native/cpp/CommonCpp/DatabaseManagers/DatabaseManager.cpp
@@ -37,10 +37,16 @@
const DatabaseQueryExecutor &DatabaseManager::getQueryExecutor() {
thread_local SQLiteQueryExecutor instance(DatabaseManager::connectionManager);
- // creating an instance means that migration code was executed
- // and finished without error and database is workable
+ // Creating an instance means the migration code was executed and finished
+ // without error, and the database is workable. We also want to start
+ // monitoring logs when this device should handle backup.
std::call_once(DatabaseManager::queryExecutorCreationIndicated, []() {
DatabaseManager::indicateQueryExecutorCreation();
+ std::string currentBackupID = instance.getMetadata("backupID");
+ if (!ServicesUtils::fullBackupSupport || !currentBackupID.size()) {
+ return;
+ }
+ DatabaseManager::connectionManager->setLogsMonitoring(true);
});
return instance;
}
diff --git a/native/cpp/CommonCpp/DatabaseManagers/SQLiteQueryExecutor.cpp b/native/cpp/CommonCpp/DatabaseManagers/SQLiteQueryExecutor.cpp
--- a/native/cpp/CommonCpp/DatabaseManagers/SQLiteQueryExecutor.cpp
+++ b/native/cpp/CommonCpp/DatabaseManagers/SQLiteQueryExecutor.cpp
@@ -66,11 +66,6 @@
std::shared_ptr<NativeSQLiteConnectionManager> connectionManager)
: connectionManager(std::move(connectionManager)) {
this->migrate();
- std::string currentBackupID = this->getMetadata("backupID");
- if (!ServicesUtils::fullBackupSupport || !currentBackupID.size()) {
- return;
- }
- SQLiteQueryExecutor::connectionManager->setLogsMonitoring(true);
}
#else

File Metadata

Mime Type
text/plain
Expires
Wed, Jan 14, 3:33 PM (5 h, 36 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
5932655
Default Alt Text
D14738.1768404825.diff (1 KB)

Event Timeline