Detect if application was started as HTTP server or not (rake task, rconsole etc)

前端 未结 6 1970
隐瞒了意图╮
隐瞒了意图╮ 2020-12-09 19:47

I\'m using EventMachine and Monetarily to start e TCP server along with my rails application. This is started from config/initializers/momentarily.rb.

6条回答
  •  谎友^
    谎友^ (楼主)
    2020-12-09 20:28

    Maybe you can implement a switch in the initializer based on ARGV?

    Something like:

    if ARGV.join(' ').match /something/
      # your initializer code here
    end
    

提交回复
热议问题