Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F33032535
D14738.1768404825.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D14738.1768404825.diff
View Options
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
Details
Attached
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)
Attached To
Mode
D14738: [SQLite] move starting log monitoring to `DatabaseManager`
Attached
Detach File
Event Timeline
Log In to Comment