Skip to content

Instantly share code, notes, and snippets.

@markomo
Created July 20, 2015 18:57
Show Gist options
  • Save markomo/e516e3443d7039405853 to your computer and use it in GitHub Desktop.
Save markomo/e516e3443d7039405853 to your computer and use it in GitHub Desktop.
require 'rubygems'
require 'roart'
class Ticket < Roart::Ticket
connection :server => 'http://nocrt.mosaic451.com', :user => 'svc_nocrt', :pass => 'pass'
end
# :first_in sets how long it takes before the job is first run. In this case, it is run immediately
SCHEDULER.every '1m', :first_in => 0 do |job|
my_tickets = Ticket.find(:all, :status => [:new, :open])
send_event('un_rt', { current: my_tickets.size })
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment