[4/4] pakfire.cgi: Remove "sleep" after running Pakfire command

Message ID 20211202153955.1126-4-hofmann@leo-andres.de
State Accepted
Commit a02f1323383869f32d43b5576c16f5f42b7fd15a
Headers show
Series [1/4] pakfire.cgi: Extend the lockfile test | expand

Commit Message

Leo-Andres Hofmann Dec. 2, 2021, 3:39 p.m. UTC
The extended lockfile test seems to be sufficient to detect
a running Pakfire process and display the logs.
"Sleep" even proved to be counterproductive, as fast processes
can finish in under a second and are then again not detected.

Signed-off-by: Leo-Andres Hofmann <hofmann@leo-andres.de>
---
 html/cgi-bin/pakfire.cgi | 5 -----
 1 file changed, 5 deletions(-)

Patch

diff --git a/html/cgi-bin/pakfire.cgi b/html/cgi-bin/pakfire.cgi
index 72518a6fe..e14658ffb 100644
--- a/html/cgi-bin/pakfire.cgi
+++ b/html/cgi-bin/pakfire.cgi
@@ -149,7 +149,6 @@  if (($cgiparams{'ACTION'} eq 'install') && (! &_is_pakfire_busy())) {
 	my @pkgs = split(/\|/, $cgiparams{'INSPAKS'});
 	if ("$cgiparams{'FORCE'}" eq "on") {
 		&General::system_background("/usr/local/bin/pakfire", "install", "--non-interactive", "--no-colors", @pkgs);
-		sleep(1);
 	} else {
 		&Header::openbox("100%", "center", $Lang::tr{'request'});
 		my @output = &General::system_output("/usr/local/bin/pakfire", "resolvedeps", "--no-colors", @pkgs);
@@ -187,7 +186,6 @@  END
 	my @pkgs = split(/\|/, $cgiparams{'DELPAKS'});
 	if ("$cgiparams{'FORCE'}" eq "on") {
 		&General::system_background("/usr/local/bin/pakfire", "remove", "--non-interactive", "--no-colors", @pkgs);
-		sleep(1);
 	} else {
 		&Header::openbox("100%", "center", $Lang::tr{'request'});
 		my @output = &General::system_output("/usr/local/bin/pakfire", "resolvedeps", "--no-colors", @pkgs);
@@ -224,10 +222,8 @@  END
 
 } elsif (($cgiparams{'ACTION'} eq 'update') && (! &_is_pakfire_busy())) {
 	&General::system_background("/usr/local/bin/pakfire", "update", "--force", "--no-colors");
-	sleep(1);
 } elsif (($cgiparams{'ACTION'} eq 'upgrade') && (! &_is_pakfire_busy())) {
 	&General::system_background("/usr/local/bin/pakfire", "upgrade", "-y", "--no-colors");
-	sleep(1);
 } elsif ($cgiparams{'ACTION'} eq "$Lang::tr{'save'}") {
 	$pakfiresettings{"TREE"} = $cgiparams{"TREE"};
 
@@ -241,7 +237,6 @@  END
 
 		# Update lists
 		&General::system_background("/usr/local/bin/pakfire", "update", "--force", "--no-colors");
-		sleep(1);
 	}
 }