[PATCH 1/2] testbot/web: Simplify JobDetailsPage::GeneratePage().

Francois Gouget fgouget at codeweavers.com
Wed Mar 7 06:31:33 CST 2018


The JobDetailsPage collection contains StepTasks, not Jobs!
But there is no need to inspect the Status of each of the Job's Tasks to
know whether it's worth reloading the page: they are all summarized in
the Job Status. So just check if the Job is still running.

Signed-off-by: Francois Gouget <fgouget at codeweavers.com>
---
 testbot/web/JobDetails.pl | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/testbot/web/JobDetails.pl b/testbot/web/JobDetails.pl
index 923ef97ae..c8ecb4c31 100644
--- a/testbot/web/JobDetails.pl
+++ b/testbot/web/JobDetails.pl
@@ -219,13 +219,9 @@ sub GeneratePage($)
 {
   my ($self) = @_;
 
-  foreach my $Job (@{$self->{Collection}->GetItems()})
+  if ($self->{Job}->Status =~ /^(queued|running)$/)
   {
-    if ($Job->Status eq "queued" || $Job->Status eq "running")
-    {
-      $self->{Request}->headers_out->add("Refresh", "30");
-      last;
-    }
+    $self->{Request}->headers_out->add("Refresh", "30");
   }
 
   $self->SUPER::GeneratePage();
-- 
2.16.1




More information about the wine-devel mailing list