Last active
December 9, 2015 14:01
-
-
Save kml/5559c5a515e042960efc to your computer and use it in GitHub Desktop.
Create pidfile before loading the application. Thanks to this monit/god knows that process exists and will not try to run other instance event when initialization takes a long time.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| gem "puma", require: false, platform: :jruby | |
| # Issue: https://github.com/puma/puma/issues/785 | |
| begin | |
| require "puma/single" | |
| class ::Puma::Single | |
| alias unpatched_run run | |
| def run | |
| unless daemon? | |
| @cli.write_pid | |
| end | |
| unpatched_run | |
| end | |
| end | |
| rescue LoadError => exception | |
| warn "#{exception.class}: #{exception.message}" | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment