Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support HTTPS for Redis task backend #101

Merged

Conversation

tmak
Copy link
Contributor

@tmak tmak commented Nov 20, 2023

The problem this PR fixes:

Setting config.processor_host to an HTTPS URL and config.mode to :development leads to processing errors as the Redis task backend doesn't configure the Net::HTTP client to use SSL.

Copy link
Member

@alachaum alachaum left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @tmak , good catch 😉 and thanks for submitting this PR 🙏

See my inline comment, I believe you can simplify the specs and make rubocop happy all in one go by meta-generating the spec blocks.

before do
allow(task).to receive(:destroy).and_return(true)
allow(task).to receive(:retry_later).with(described_class::RETRY_INTERVAL).and_return(true)
context 'with HTTP' do
Copy link
Member

@alachaum alachaum Nov 20, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can probably meta-generate the specs to avoid repetition 😉

E.g.

['http', 'https'].each do |tested_protocol|
  context "with #{tested_protocol.upcase}" do
    let(:url) { "#{tested_protocol}://localhost:300/run" }
    ...
  end
end

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed.

@tmak tmak force-pushed the support-https-for-redis-task-backend branch from 14d074b to a17be40 Compare November 20, 2023 18:55
Copy link
Member

@alachaum alachaum left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 thanks

@alachaum alachaum merged commit dd77d7e into keypup-io:master Nov 21, 2023
59 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants