Permalink
Browse files

1500ms cache

  • Loading branch information...
sorah committed Oct 31, 2015
1 parent 61b49c7 commit 341d6f134e91706f23ec813232984af4db63bc5b
Showing with 2 additions and 2 deletions.
  1. +2 −2 5f/webapp/ruby/app.rb
View
@@ -102,7 +102,7 @@ def fetch_with_cache(conf, redis)
else
res = fetch(conf)
if @expirable
redis.psetex("api/cache/#{hash}", 3000, res.to_msgpack)
redis.psetex("api/cache/#{hash}", 1500, res.to_msgpack)
else
redis.set("api/cache/#{hash}", res.to_msgpack)
end
@@ -427,7 +427,7 @@ def fetch_api(method, uri, headers, params)
Expeditor::Command.new do
perfectsecs.map do |service, conf|
endpoint = Isucon5f::Endpoint.get(service)
{"service" => service, "data" => endpoint.fetch(conf)}
{"service" => service, "data" => endpoint.fetch_with_cache(conf, redis)}
end
end
)

0 comments on commit 341d6f1

Please sign in to comment.