Skip to content

Ferrum::PendingConnectionsError - what to do? #437

Description

@yshmarov

In my app I want to have a "generate pdf" controller action

Scenario:

when a user clicks

link_to 'Projects PDF', projects_path(format: :pdf)

it hits the controller action in PDF format, that opens a ferrum browser and visits the controller action in HTML format:

# app/controllers/projects_controller.rb
def index
  respond_to do |format|
    format.html
    format.pdf do
      browser = Ferrum::Browser.new
      browser.go_to(projects_path)
      browser.pdf
    end
  end
end

In this case I will often get the Ferrum::PendingConnectionsError error with Request to http://localhost:3000/projects reached server, but there are still pending connections: http:/localhost:3000/projects

Screenshot 2024-01-15 at 13 16 24

Are there some best practices to follow to avoid this error?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions