Merge branch 'main' of http://alex-freenas.ddns.net:3000/M/VisualSapfor
This commit is contained in:
@@ -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);
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
12
|
13
|
||||||
Reference in New Issue
Block a user