From c6a0f43aaa6136c19c7f41f3dca8988723a2f95d Mon Sep 17 00:00:00 2001 From: pezcurrel Date: Mon, 26 Feb 2024 19:21:01 +0100 Subject: [PATCH] If no instance is to be checked, exit soon --- web/clitools/crawler.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/web/clitools/crawler.php b/web/clitools/crawler.php index b0a6031..3a9b155 100755 --- a/web/clitools/crawler.php +++ b/web/clitools/crawler.php @@ -278,6 +278,7 @@ if ($restore) { shuffle($insts); $cinsts=count($insts); eecho(1,$cinsts.' instances to be checked.'.N); + if ($cinsts==0) mexit('nothing to do, bye.'.N,0,true); $instsf=@fopen($instsjfp,'w'); if ($instsf===false) mexit('could not open «'.$instsjfp.'» for writing.'.N,1,true); @@ -330,7 +331,7 @@ do { } } } - $out=$done.'/'.$cinsts.' ('.round(100/$cinsts*$done).'%); elapsed time: '.ght($tet,null,0); + $out=$done.'/'.$cinsts.' ('.round(100*$done/$cinsts).'%); elapsed time: '.ght($tet,null,0); if ($done>0) $out.='; estimated time remaining: '.ght($cinsts*$tet/$done-$tet,null,0); eecho(1,$out.'.'.N); if ($somerun) {