From 695b38201c88bad248a59dc56500b3ded95c10f2 Mon Sep 17 00:00:00 2001 From: chenming Date: Tue, 15 Feb 2022 16:11:43 +0800 Subject: [PATCH 1/2] add max work of uid Signed-off-by: chenming --- services/native/src/work_policy_manager.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/services/native/src/work_policy_manager.cpp b/services/native/src/work_policy_manager.cpp index 63482bb..a626050 100644 --- a/services/native/src/work_policy_manager.cpp +++ b/services/native/src/work_policy_manager.cpp @@ -85,7 +85,7 @@ bool WorkPolicyManager::AddWork(shared_ptr workStatus, int32_t uid) if (uidQueueMap_.at(uid)->Contains(make_shared(workStatus->workId_))) { WS_HILOGE("Workid has been added, should remove first."); return false; - } else if (uidQueueMap_.at(uid)->GetSize() > MAX_WORK_COUNT_PER_UID) { + } else if (uidQueueMap_.at(uid)->GetSize() >= MAX_WORK_COUNT_PER_UID) { WS_HILOGE("each uid only can be added %{public}d works", MAX_WORK_COUNT_PER_UID); return false; } -- Gitee From 3277bc669f086ee961f5e303a59422dac71a6de9 Mon Sep 17 00:00:00 2001 From: chenming Date: Tue, 15 Feb 2022 16:30:15 +0800 Subject: [PATCH 2/2] add dump info Signed-off-by: chenming --- utils/dump/src/workscheduler_shell_command.cpp | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/utils/dump/src/workscheduler_shell_command.cpp b/utils/dump/src/workscheduler_shell_command.cpp index c46159a..d8aeca2 100644 --- a/utils/dump/src/workscheduler_shell_command.cpp +++ b/utils/dump/src/workscheduler_shell_command.cpp @@ -36,11 +36,16 @@ namespace { static const std::string DUMP_HELP_MSG = "usage: workscheduler dump []\n" "options list:\n" - " -h help menu\n" - " -A All dump all infos\n" - " -A WorkQueue dump work queue infos\n" - " -A WorkPolicy dump work policy infos\n" - " -E help show publish common event help menu\n"; + " -h help menu\n" + " -A All dump all infos\n" + " -A WorkQueue dump work queue infos\n" + " -A WorkPolicy dump work policy infos\n" + " -A DebugInfo dump debug info\n" + " -A CheckBundle (bool) set debug of checking bundle, default false\n" + " -A SetFixMemory (number) fix the available memory\n" + " -A SetWatchdogTime (number) set watch dog time, default 120000\n" + " -A SetRepeatCycleTimeMin (number) set min repeat cycle time, default 1200000\n" + " -E help show publish common event help menu\n"; } // namespace WorkSchedulerShellCommand::WorkSchedulerShellCommand(int argc, char *argv[]) : ShellCommand(argc, argv, "workscheduler") -- Gitee