We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5a699af commit 6e816fcCopy full SHA for 6e816fc
src/detection/cpuusage/cpuusage.c
@@ -27,6 +27,7 @@ const char* ffGetCpuUsageResult(FFlist* result)
27
if(cpuTimes1.length == 0) return "No CPU cores found";
28
29
FF_LIST_AUTO_DESTROY cpuTimes2 = ffListCreate(sizeof(FFCpuUsageInfo));
30
+ uint32_t retryCount = 0;
31
32
retry:
33
error = ffGetCpuUsageInfo(&cpuTimes2);
@@ -41,6 +42,8 @@ const char* ffGetCpuUsageResult(FFlist* result)
41
42
{
43
ffListClear(&cpuTimes2);
44
ffTimeSleep(200);
45
+ if (++retryCount >= 10)
46
+ return "Retry count exceeded";
47
goto retry;
48
}
49
0 commit comments