Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- require 'active_record'
- require 'dashing'
- EM::threadpool_size = 20
- ActiveRecord::Base.establish_connection(
- :adapter => "mysql2",
- :host => "10.1.150.24",
- :database => "dashboards",
- :username => "root",
- :password => "xxx",
- :encoding => "utf8",
- :pool => 20
- )
- configure do
- set :auth_token, 'xxx'
- set :protection, :except => :frame_options
- helpers do
- def protected!
- # Put any authentication code you want in here.
- # This method is run before accessing any resource.
- end
- end
- end
- map Sinatra::Application.assets_prefix do
- run Sinatra::Application.sprockets
- end
- run Sinatra::Application
- SCHEDULER.every '30m', first_in => 0 do
- data = ActiveRecord::Base.connection.execute("SELECT * FROM ......")
- ##work with data
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement