Skip to content

Commit cde6d1c

Browse files
committed
save
1 parent c797a84 commit cde6d1c

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

be/src/agent/task_worker_pool.cpp

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -497,11 +497,14 @@ void add_task_count(const TAgentTaskRequest& task, int n) {
497497
{
498498
ALTER_count << n;
499499
// cloud auto stop need sc jobs, a tablet's sc can also be considered a fragment
500-
doris::g_fragment_executing_count << 1;
501-
int64 now = duration_cast<std::chrono::milliseconds>(
502-
std::chrono::system_clock::now().time_since_epoch())
503-
.count();
504-
g_fragment_last_active_time.set_value(now);
500+
if (n > 0) {
501+
// only count fragment when task is actually starting
502+
doris::g_fragment_executing_count << 1;
503+
int64_t now = duration_cast<std::chrono::milliseconds>(
504+
std::chrono::system_clock::now().time_since_epoch())
505+
.count();
506+
g_fragment_last_active_time.set_value(now);
507+
}
505508
return;
506509
}
507510
default:

0 commit comments

Comments
 (0)