[SCM] ci-tooling packaging branch, master, updated. 3d20ec1ade696eed3b7fb83d2b20aa70d6fd8896

Harald Sitter apachelogger-guest at moszumanska.debian.org
Tue Dec 16 08:50:12 UTC 2014


Gitweb-URL: http://git.debian.org/?p=pkg-kde/ci-tooling.git;a=commitdiff;h=3d20ec1

The following commit has been merged in the master branch:
commit 3d20ec1ade696eed3b7fb83d2b20aa70d6fd8896
Author: Harald Sitter <sitter at kde.org>
Date:   Tue Dec 16 09:41:07 2014 +0100

    force no server-side caching in lp as we have no case where it is desired
---
 lib/lp.rb | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/lib/lp.rb b/lib/lp.rb
index 5ae0f33..ae81b3d 100644
--- a/lib/lp.rb
+++ b/lib/lp.rb
@@ -53,7 +53,18 @@ module Launchpad
         if @token
             return @token.get(uri.path)
         end
-        return Net::HTTP.get(uri)
+
+        # Set cache control.
+        # Launchpad employs server-side caching, which is nice but for our purposes
+        # 90% of the time we need current data, otherwise we wouldn't be polling
+        # on a schedule.
+        d = nil
+        Net::HTTP.start(uri.hostname,
+                        uri.port,
+                        :use_ssl => (uri.scheme == 'https')) do |http|
+            d = http.request_get(uri, "Cache-Control" => "max-age=0").body
+        end
+        return d
     end
 
     def self.post(uri)

-- 
ci-tooling packaging



More information about the pkg-kde-commits mailing list