Skip to content
This repository has been archived by the owner on Jan 3, 2025. It is now read-only.

Commit

Permalink
allow worker to connect to redis and fix it from dying if it can't (#670
Browse files Browse the repository at this point in the history
)
  • Loading branch information
FinnIckler authored Sep 2, 2024
1 parent 95e0519 commit 78db8ab
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 5 deletions.
3 changes: 0 additions & 3 deletions app/controllers/registration_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,6 @@ def create

RegistrationProcessor.set(message_group_id: message_group_id, message_deduplication_id: message_deduplication_id).perform_later(step_data)

# Invalidate Cache
Rails.cache.delete("#{@user_id}-registrations-by-user")

render json: { status: 'accepted', message: 'Started Registration Process' }, status: :accepted
end

Expand Down
1 change: 1 addition & 0 deletions app/jobs/registration_processor.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ def perform(message)
message[:step_details][:guests],
message[:created_at])
end
Rails.cache.delete("#{message[:user_id]}-registrations-by-user")
end

private
Expand Down
2 changes: 1 addition & 1 deletion config/environments/production.rb
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
# Use a different cache store in production.
config.cache_store = :redis_cache_store, {
url: EnvConfig.REDIS_URL,
connect_timeout: 30, # Defaults to 20 seconds
connect_timeout: 5, # Defaults to 20 seconds
read_timeout: 0.2, # Defaults to 1 second
write_timeout: 0.2, # Defaults to 1 second
reconnect_attempts: 1, # Defaults to 0
Expand Down
2 changes: 1 addition & 1 deletion infra/worker/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ resource "aws_ecs_service" "this" {
}

network_configuration {
security_groups = []
security_groups = [var.shared_resources.cluster_security.id]
subnets = var.shared_resources.private_subnets
}

Expand Down

0 comments on commit 78db8ab

Please sign in to comment.