Skip to content

Commit

Permalink
Expire json payload just in case
Browse files Browse the repository at this point in the history
  • Loading branch information
kbaum committed Oct 11, 2019
1 parent 0190c7d commit 3f9003a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/coverband/adapters/hash_redis_store.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ class HashRedisStore < Base
###
REDIS_STORAGE_FORMAT_VERSION = 'coverband_hash_3_3'

JSON_PAYLOAD_EXPIRATION = 5 * 60

attr_reader :redis_namespace

def initialize(redis, opts = {})
Expand Down Expand Up @@ -78,7 +80,7 @@ def save_report(report)
return unless keys.any?

arguments_key = [@redis_namespace, SecureRandom.uuid].compact.join('.')
@redis.set(arguments_key, json)
@redis.set(arguments_key, json, ex: JSON_PAYLOAD_EXPIRATION)
@redis.evalsha(script_id, [arguments_key])
@redis.sadd(files_key, keys)
end
Expand Down

0 comments on commit 3f9003a

Please sign in to comment.