aboutsummaryrefslogtreecommitdiffstats
path: root/src/module/GpgFrontendModuleInit.cpp
diff options
context:
space:
mode:
authorsaturneric <[email protected]>2023-12-03 20:25:21 +0000
committersaturneric <[email protected]>2023-12-03 20:25:21 +0000
commit054e6e28cca2517dda2319ef683314b3318c39a6 (patch)
treeae9ff4a9fe280f3640ca249bad45ab250cfd1610 /src/module/GpgFrontendModuleInit.cpp
parentfix: slove issues in key/subkey generation (diff)
downloadGpgFrontend-054e6e28cca2517dda2319ef683314b3318c39a6.tar.gz
GpgFrontend-054e6e28cca2517dda2319ef683314b3318c39a6.zip
feat: standarized and speed up app env loading process
Diffstat (limited to '')
-rw-r--r--src/module/GpgFrontendModuleInit.cpp22
1 files changed, 19 insertions, 3 deletions
diff --git a/src/module/GpgFrontendModuleInit.cpp b/src/module/GpgFrontendModuleInit.cpp
index 367d1be1..1e83af0e 100644
--- a/src/module/GpgFrontendModuleInit.cpp
+++ b/src/module/GpgFrontendModuleInit.cpp
@@ -29,7 +29,9 @@
#include "GpgFrontendModuleInit.h"
#include <core/module/ModuleManager.h>
-#include <module/sdk/Log.h>
+
+#include "core/thread/Task.h"
+#include "core/thread/TaskRunnerGetter.h"
// integrated modules
#include "integrated/gnupg_info_gathering_module/GnuPGInfoGatheringModule.h"
@@ -37,8 +39,17 @@
namespace GpgFrontend::Module {
+void LoadGpgFrontendModulesLoggingSystem(ModuleInitArgs args) {
+ GpgFrontend::Module::SDK::InitModuleLoggingSystem(args.log_level);
+}
+
+void ShutdownGpgFrontendModulesLoggingSystem() {
+ GpgFrontend::Module::SDK::ShutdownModuleLoggingSystem();
+}
+
void LoadGpgFrontendModules(ModuleInitArgs args) {
- SDK::InitModuleLoggingSystem(args.log_level);
+ // init the logging system for module system
+ LoadGpgFrontendModulesLoggingSystem(args);
MODULE_LOG_INFO("loading integrated module...");
@@ -51,8 +62,13 @@ void LoadGpgFrontendModules(ModuleInitArgs args) {
Integrated::GnuPGInfoGatheringModule::GnuPGInfoGatheringModule>();
MODULE_LOG_INFO("load integrated module done.");
+
+ // must init at default thread before core
+ Thread::TaskRunnerGetter::GetInstance().GetTaskRunner()->PostTask(
+ new Thread::Task([](const DataObjectPtr&) -> int { return 0; },
+ "modules_system_init_task"));
}
-void ShutdownGpgFrontendModules() { SDK::ShutdownModuleLoggingSystem(); }
+void ShutdownGpgFrontendModules() {}
} // namespace GpgFrontend::Module \ No newline at end of file