Skip to content

Commit

Permalink
Move keys set within pipelined
Browse files Browse the repository at this point in the history
  • Loading branch information
kbaum committed Jul 26, 2019
1 parent f596c5b commit 320cea5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/coverband/adapters/hash_redis_store.rb
Expand Up @@ -34,6 +34,7 @@ def clear!
def save_report(report)
report_time = Time.now.to_i
updated_time = type == Coverband::EAGER_TYPE ? nil : report_time
keys = report.keys.map { |file| full_path_to_relative(file) }
@redis.pipelined do
report.each do |file, data|
key = key(full_path_to_relative(file))
Expand All @@ -46,9 +47,8 @@ def save_report(report)
end
@redis.hmset(key, LAST_UPDATED_KEY, updated_time, FILE_HASH, file_hash(file))
@redis.hsetnx(key, FIRST_UPDATED_KEY, report_time)
@redis.sadd(files_key, keys) if keys.any?
end
keys = report.keys.map { |file| full_path_to_relative(file) }
@redis.sadd(files_key, keys) if keys.any?
end
end

Expand Down

0 comments on commit 320cea5

Please sign in to comment.