Skip to content

Commit

Permalink
Merge pull request #558 from alphagov/redis-url
Browse files Browse the repository at this point in the history
Remove need for REDIS_HOST and REDIS_PORT env vars
  • Loading branch information
kevindew authored Jan 15, 2021
2 parents 4a29be5 + 7623dad commit e151e6e
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 18 deletions.
7 changes: 1 addition & 6 deletions app/services/organisation_importer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ def initialize(api_url_base = nil)
end

def perform!
redis.lock("short_url_manager:#{Rails.env}:organisation_importer_lock", life: 2.hours) do
Redis.current.lock("short_url_manager:#{Rails.env}:organisation_importer_lock", life: 2.hours) do
organisations_data = get_organisations_data
Organisation.destroy_all
organisations_data.each do |attrs|
Expand All @@ -35,9 +35,4 @@ def get_organisations_data
def api_adapter
@api_adapter ||= GdsApi::Organisations.new(api_url_base)
end

def redis
redis_config = Rails.application.config_for(:redis)
Redis.new(redis_config.symbolize_keys)
end
end
12 changes: 0 additions & 12 deletions config/redis.yml

This file was deleted.

0 comments on commit e151e6e

Please sign in to comment.