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

Allow to configure boot and connect timeout #712

Merged
merged 1 commit into from
Apr 22, 2024
Merged

Conversation

byroot
Copy link
Member

@byroot byroot commented Apr 16, 2024

The hardcoded values might not be enough for all applications.

lib/spring/client/run.rb Outdated Show resolved Hide resolved
Copy link

@jenshenny jenshenny left a comment

Choose a reason for hiding this comment

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

Thanks! Other than the comment I put with the accessors, LGTM

Comment on lines 8 to 12
attr_accessor :connect_timeout
@connect_timeout = 5

attr_accessor :boot_timeout
@boot_timeout = 20

Choose a reason for hiding this comment

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

These instance variables aren't being correctly set currently (the accessors return nil)

`+': can't convert NilClass into an exact number (TypeError)

It works if you place them outside of the class methods

module Spring
  @connect_timeout = 5
  @boot_timeout = 20

  class << self

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah, sorry, just did a quick patch without testing before leaving my desk. I think it should be good now.

The hardcoded values might not be enough for all applications.
@bendilley
Copy link

I'm getting a lot of this with spring 4.2.0:

/Users/ben/.gem/ruby/3.2.0/gems/spring-4.2.0/lib/spring/client/run.rb:126:in `verify_server_version': Error connecting to Spring server (RuntimeError)

I'm hoping this PR might allow me to fix that by adjusting the timeout.

@byroot byroot merged commit 47ccb11 into main Apr 22, 2024
18 of 22 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.

3 participants