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

Allow worker to connect to redis and fix it from dying if it can't #670

Merged
merged 1 commit into from
Sep 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading