Forráskód Böngészése

Fix #150: cache by suite ID rather than project ID in getSections

George S. Baugh 7 éve
szülő
commit
483457a0f8
2 módosított fájl, 4 hozzáadás és 3 törlés
  1. 1 0
      Changes
  2. 3 3
      lib/TestRail/API.pm

+ 1 - 0
Changes

@@ -4,6 +4,7 @@ Revision history for Perl module TestRail::API
     - Add getCaseFields and addCaseField methods to TestRail::API
     - Correct argument POD for createRunInPlan
     - Add bulkAddResultsByCase
+    - Fix improper caching by project rather than by testsuite in getSections
 
 0.043 2018-6-16 TEODESIAN
     - Better error messaging when bad custom result fields are configured in Test::Rail::Parser

+ 3 - 3
lib/TestRail/API.pm

@@ -743,10 +743,10 @@ sub getSections {
     my ($self,$project_id,$suite_id) = $check->(@_);
 
     #Cache sections to reduce requests in tight loops
-    return $self->{'sections'}->{$project_id} if $self->{'sections'}->{$project_id};
-    $self->{'sections'}->{$project_id} = $self->_doRequest("index.php?/api/v2/get_sections/$project_id&suite_id=$suite_id");
+    return $self->{'sections'}->{$suite_id} if $self->{'sections'}->{$suite_id};
+    $self->{'sections'}->{$suite_id} = $self->_doRequest("index.php?/api/v2/get_sections/$project_id&suite_id=$suite_id");
 
-    return $self->{'sections'}->{$project_id};
+    return $self->{'sections'}->{$suite_id};
 }
 
 =head2 B<getSectionByID (section_id)>