Skip to content

Commit

Permalink
fix for 403 configuration page when no redis data available
Browse files Browse the repository at this point in the history
  • Loading branch information
danmayer committed Sep 30, 2020
1 parent 339fdda commit d3f14da
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 5 additions & 1 deletion lib/coverband/adapters/base.rb
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,11 @@ def coverage(_local_type = nil)
end

def size_in_mib
format("%<size>.2f", size: (size.to_f / 2**20))
if size
format("%<size>.2f", size: (size.to_f / 2**20))
else
"N/A"
end
end

def save_report(_report)
Expand Down
2 changes: 1 addition & 1 deletion lib/coverband/adapters/redis_store.rb
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ def clear_file!(filename)
end

def size
@redis.get(base_key).bytesize
@redis.get(base_key) ? @redis.get(base_key).bytesize : "N/A"
end

###
Expand Down

0 comments on commit d3f14da

Please sign in to comment.