diff options
author | Mario Vavti <mario@mariovavti.com> | 2021-10-01 17:24:19 +0200 |
---|---|---|
committer | Mario Vavti <mario@mariovavti.com> | 2021-10-01 17:24:19 +0200 |
commit | 9a87b8bf1b4384660822f6cb820dbc09e308d07f (patch) | |
tree | 7e41f84de7fcd8aaa3a4cdeb4794ccd34a15afe0 /Zotlabs | |
parent | dac27aab6810473fa020120d348c51dcf93e2d79 (diff) | |
download | volse-hubzilla-9a87b8bf1b4384660822f6cb820dbc09e308d07f.tar.gz volse-hubzilla-9a87b8bf1b4384660822f6cb820dbc09e308d07f.tar.bz2 volse-hubzilla-9a87b8bf1b4384660822f6cb820dbc09e308d07f.zip |
only allow resume if we are not completed yet
Diffstat (limited to 'Zotlabs')
-rw-r--r-- | Zotlabs/Module/Import_progress.php | 21 |
1 files changed, 9 insertions, 12 deletions
diff --git a/Zotlabs/Module/Import_progress.php b/Zotlabs/Module/Import_progress.php index cc4f0c0ea..06498f649 100644 --- a/Zotlabs/Module/Import_progress.php +++ b/Zotlabs/Module/Import_progress.php @@ -29,11 +29,6 @@ class Import_progress extends \Zotlabs\Web\Controller { } else { - if(argv(1) === 'restart_itemsync') { - Master::Summon($c['next_cmd']); - goaway('/import_progress'); - } - $total_cpages = floor(intval($c['items_total']) / intval($c['items_page'])); if(!$total_cpages) { $total_cpages = 1; // because of floor @@ -43,7 +38,10 @@ class Import_progress extends \Zotlabs\Web\Controller { $cprogress = intval(floor((intval($cpage) * 100) / $total_cpages)); - + if(argv(1) === 'resume_itemsync' && $cprogress < 100) { + Master::Summon($c['next_cmd']); + goaway('/import_progress'); + } } $cprogress_str = ((intval($cprogress)) ? $cprogress . '%' : $cprogress); @@ -55,12 +53,6 @@ class Import_progress extends \Zotlabs\Web\Controller { $fprogress = 'waiting to start...'; } else { - - if(argv(1) === 'restart_filesync') { - Master::Summon($f['next_cmd']); - goaway('/import_progress'); - } - $total_fpages = floor(intval($f['files_total']) / intval($f['files_page'])); if(!$total_fpages) { $total_fpages = 1; @@ -70,6 +62,11 @@ class Import_progress extends \Zotlabs\Web\Controller { $fprogress = intval(floor((intval($fpage) * 100) / $total_fpages)); + if(argv(1) === 'resume_filesync' && $fprogress < 100) { + Master::Summon($f['next_cmd']); + goaway('/import_progress'); + } + } $fprogress_str = ((intval($fprogress)) ? $fprogress . '%' : $fprogress); |