!32611 fix DetectFirstBatch exit late

Merge pull request !32611 from luoyang/log
This commit is contained in:
i-robot 2022-04-07 14:17:02 +00:00 committed by Gitee
commit 4ef0ed4ade
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
1 changed files with 2 additions and 1 deletions

View File

@ -750,9 +750,10 @@ Status DeviceQueueOp::DetectFirstBatch() {
TaskManager::FindMe()->Post();
uint8_t count_num = 0;
uint64_t temp_start_time = ProfilingTime::GetCurMilliSecond();
constexpr int check_interval = 200;
while (true) {
RETURN_IF_INTERRUPTED();
std::this_thread::sleep_for(std::chrono::milliseconds(2000));
std::this_thread::sleep_for(std::chrono::milliseconds(check_interval));
uint64_t temp_end_time = ProfilingTime::GetCurMilliSecond();
// if fetch first batch, or detect 3 or more times and unable fetch first batch, exist with already printed Warning
if (first_fetch_flag_ == true || count_num > 2) {