This commit is contained in:
2025-03-04 02:15:32 +03:00
2 changed files with 13 additions and 7 deletions

View File

@@ -157,10 +157,11 @@ public:
vector<T*> toDel; vector<T*> toDel;
size_t done = 0; size_t done = 0;
size_t step = ceil(totalProcessTasks * 0.02); // step == 2% size_t step = ceil(totalProcessTasks * 0.01); // step == 1%
const double total = totalProcessTasks; const double total = totalProcessTasks;
auto timer_start = Utils::getAbsoluteTime(); auto timer_pause = Utils::getAbsoluteTime();
while (activeTasks) { while (activeTasks) {
long oldActiveTasks = activeTasks; long oldActiveTasks = activeTasks;
emptyKeys.clear(); emptyKeys.clear();
@@ -227,13 +228,13 @@ public:
} }
} }
// прошло больше 10 секунд, проверяем паузу // прошло больше 30 секунд, проверяем паузу
if (Utils::getAbsoluteTime() - timer_start > 30) { if (Utils::getAbsoluteTime() - timer_pause > 30) {
printf("stoped\n"); printf("stoped\n");
while (checkPause()) { while (checkPause()) {
Utils::Sleep(10); Utils::Sleep(10);
} }
timer_start = Utils::getAbsoluteTime(); timer_pause = Utils::getAbsoluteTime();
printf("resume\n"); printf("resume\n");
} }
} }
@@ -253,7 +254,12 @@ public:
} }
void saveProgress(long long persentDone) { void saveProgress(long long persentDone) {
FILE *f = fopen("progress", "w"); /*String dump_progress = "echo '";
dump_progress = dump_progress + to_string(persentDone).c_str() + "' > progress";
system(dump_progress.getCharArray());*/
FILE* f = fopen("progress", "w");
if (f) { if (f) {
fprintf(f, "%lld", persentDone); fprintf(f, "%lld", persentDone);
fflush(f); fflush(f);

View File

@@ -1 +1 @@
12 13