perf.以一种更安全的方式禁用SubTask

This commit is contained in:
MistEO
2022-03-12 21:51:09 +08:00
parent 8962da2278
commit dca1aebeef
8 changed files with 47 additions and 25 deletions

View File

@@ -1,9 +1,14 @@
#include "PackageTask.h"
#include "Resource.h"
#include "Logger.hpp"
bool asst::PackageTask::run()
{
if (!m_enable) {
Log.info("task is disable, pass", basic_info().to_string());
return true;
}
m_runned = true;
const auto task_delay = Resrc.cfg().get_options().task_delay;
@@ -12,9 +17,6 @@ bool asst::PackageTask::run()
if (need_exit()) {
return false;
}
if (!task_ptr) {
continue;
}
task_ptr->set_exit_flag(m_exit_flag)
.set_ctrler(m_ctrler)