Skip to content

Commit

Permalink
FIX: version check job when no versions are returned in json
Browse files Browse the repository at this point in the history
  • Loading branch information
nlalonde committed Jan 7, 2014
1 parent bcfaf52 commit 92f0c65
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions lib/discourse_updates.rb
Original file line number Diff line number Diff line change
Expand Up @@ -80,15 +80,18 @@ def missing_versions=(versions)
$redis.del(missing_versions_list_key)
end

# store the list in redis
version_keys = []
versions[0,5].each do |v|
key = "#{missing_versions_key_prefix}:#{v['version']}"
$redis.mapped_hmset key, v
version_keys << key
if versions.present?
# store the list in redis
version_keys = []
versions[0,5].each do |v|
key = "#{missing_versions_key_prefix}:#{v['version']}"
$redis.mapped_hmset key, v
version_keys << key
end
$redis.rpush missing_versions_list_key, version_keys
end
$redis.rpush missing_versions_list_key, version_keys
versions

versions || []
end

def missing_versions
Expand Down

0 comments on commit 92f0c65

Please sign in to comment.