On Friday, January 19, 2018 at 11:33:26 AM UTC-8, David Lazar wrote:
>
>
> Thanks for the help!
>
> I am so frustrated by this... the terminology is what is killing me. I 
> have a free worker and a free Dyno for this test... and all the code works, 
> until I send a second request to the worker. I suspect it is all me.. 
>
> I created a gist of the config files I use.. not sure that is too helpful, 
> but anyway, this setup of Puma, Sequel at heroku with a worker, is 
> troubling me... 
>
> https://gist.github.com/resistorsoftware/f77b15e66c9362b8c9b7f281bccc1851
>

Right in your gist it shows you using preload_app! in your puma config, and 
your on_worker_boot code is wrong 
as Sequel::Model.db.connect(ENV['DATABASE_URL']) just creates a connection 
that will be garbage collected later.

You probably should remove the Sequel code from on_worker_boot, and add the 
following to your puma config:

before_fork do
  Sequel::Model.db.disconnect if defined?(Sequel::Model)
end

Thanks,
Jeremy

-- 
You received this message because you are subscribed to the Google Groups 
"sequel-talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/sequel-talk.
For more options, visit https://groups.google.com/d/optout.

Reply via email to