Something went wrong. Try again.
Don't forget to lycansubscribe 🐺
Something went wrong. Try again.
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657#!/usr/bin/env ruby
$LOAD_PATH.unshift(File.expand_path('..', __dir__))
require 'bundler/setup'require 'app/firehose_client'
$stdout.sync = true
if ENV['ARLOG'] == '1' ActiveRecord::Base.logger = Logger.new(STDOUT)else ActiveRecord::Base.logger = nilend
def print_help puts "Usage: #{$0} [options...]" puts "Options:" puts " -r12345 = start from cursor 12345"end
firehose = FirehoseClient.new
args = ARGV.dup
while arg = args.shift case arg when /^\-r(\d+)$/ firehose.start_cursor = $1.to_i when '-h', '--help' print_help exit 0 else puts "Unrecognized option: #{arg}" print_help exit 1 endend
trap("SIGINT") { firehose.log "Stopping..."
EM.add_timer(0) { firehose.stop }}
trap("SIGTERM") { firehose.log "Shutting down the service..."
EM.add_timer(0) { firehose.stop }}
firehose.start