lib/valnzbn/lookup.rb in valnzbn-0.1.4 vs lib/valnzbn/lookup.rb in valnzbn-0.1.5
- old
+ new
@@ -54,10 +54,10 @@
begin
response = HTTParty.get("#{url}#{number}", headers: { 'Authorization' => "Bearer #{@@access_token}" }).parsed_response
response = JSON.parse(response.to_json, symbolize_names: true)
response[:expires_at] = (Time.now + 7200).to_i
- namespaced_redis.set(number, response.to_json) if @@cache_port && @@cache_host
+ namespaced_redis.set(number, response.to_json, ex: 7200) if @@cache_port && @@cache_host
response
rescue
nil
end
end
\ No newline at end of file