This file contains 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
select id from chouti_links where pool = 0 and (createTime > (unix_timestamp(now())-86400)*1000000) order by score desc limit 1 |
This file contains 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
require 'amqp' | |
module HiringThingEM | |
def self.start | |
if defined?(PhusionPassenger) | |
PhusionPassenger.on_event(:starting_worker_process) do |forked| | |
# for passenger, we need to avoid orphaned threads | |
if forked && EM.reactor_running? | |
EM.stop | |
end | |
Thread.new { |