]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 1495741 - memory issues: disable etag generation for /rest/product
authorDylan William Hardison <dylan@hardison.net>
Sat, 13 Oct 2018 04:33:18 +0000 (00:33 -0400)
committerGitHub <noreply@github.com>
Sat, 13 Oct 2018 04:33:18 +0000 (00:33 -0400)
Bugzilla/WebService/Product.pm
Bugzilla/WebService/Server.pm

index 0b58c6e1c72d696d87cccddc2c184372c65969a8..8ee6ff43f4acf4fdd3e48a53017403fde462c9a7 100644 (file)
@@ -68,6 +68,8 @@ sub get {
     my ($self, $params) = validate(@_, 'ids', 'names', 'type');
     my $user = Bugzilla->user;
 
+    Bugzilla->request_cache->{bz_etag_disable} = 1;
+
     defined $params->{ids} || defined $params->{names} || defined $params->{type}
         || ThrowCodeError("params_required", { function => "Product.get",
                                                params => ['ids', 'names', 'type'] });
index e027889119b99673178354390d1d3301e8d26730..c4bd3e605fcaf51f26107276f27c775fffe0e970 100644 (file)
@@ -81,7 +81,11 @@ sub datetime_format_outbound {
 sub bz_etag {
     my ($self, $data) = @_;
     my $cache = Bugzilla->request_cache;
-    if (defined $data) {
+
+    if (Bugzilla->request_cache->{bz_etag_disable}) {
+      return undef;
+    }
+    elsif (defined $data) {
         # Serialize the data if passed a reference
         local $Storable::canonical = 1;
         $data = freeze($data) if ref $data;