Last active
January 15, 2019 12:46
Revisions
-
dylanahsmith revised this gist
Apr 7, 2014 . 1 changed file with 0 additions and 1 deletion.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -7,7 +7,6 @@ pid = fork do loop do client = Mysql2::Client.new client.close end end -
dylanahsmith created this gist
Apr 7, 2014 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,19 @@ #!/usr/bin/env ruby require 'mysql2' trap("USR2") {} pid = fork do loop do client = Mysql2::Client.new client.ping or abort("ping failed") client.close end end until Process.waitpid(pid, Process::WNOHANG) Process.kill("USR2", pid) sleep 0.01 end puts $?.to_s