Shopify / dashing

The exceptionally handsome dashboard framework in Ruby and Coffeescript.
http://shopify.github.com/dashing/
MIT License
10.97k stars 1.18k forks source link

Scheduler running twice when started by CLI tool #365

Closed lazyfrosch closed 10 years ago

lazyfrosch commented 10 years ago

Hey, has anyone ever noticed that the Rufus scheduler is running twice?

I noticed that while trying to supply configuration for my job via config.ru

This line is executed twice:

  SCHEDULER = Rufus::Scheduler.new
  1. By the GEM loader
  2. From within thin

You can see this by adding the following lines:

puts "called dashing"
puts caller
puts "======="
SCHEDULER = Rufus::Scheduler.new

Has anyone ever noticed that?

I will think about a solution for this.

Cheers Markus

lazyfrosch commented 10 years ago

Of course this only happens when using the CLI tool and "start" to run the server.

This shouldn't happen when running thin directly.

bstephenf commented 10 years ago

On the latest 1.3.3 of dashing, I am noticing that when I start dashing (using: dashing start), I get this in my output (which would indicate it is running twice) - This is out of the box starting dashing right after a fresh install:

Stephen-Brehm:hf-dataops-dashboard sbrehm$ dashing start /Users/sbrehm/hf-dataops-dashboard/jobs/twitter.rb:9:in block in <top (required)>': [DEPRECATION] #oauth_token= is deprecated. Use #access_token= instead. /Users/sbrehm/hf-dataops-dashboard/jobs/twitter.rb:10:inblock in <top (required)>': [DEPRECATION] #oauth_token_secret= is deprecated. Use #access_token_secret= instead. /Users/sbrehm/hf-dataops-dashboard/jobs/twitter.rb:9:in block in <top (required)>': [DEPRECATION] #oauth_token= is deprecated. Use #access_token= instead. /Users/sbrehm/hf-dataops-dashboard/jobs/twitter.rb:10:inblock in <top (required)>': [DEPRECATION] #oauth_token_secret= is deprecated. Use #access_token_secret= instead. Thin web server (v1.6.2 codename Doc Brown) Maximum connections set to 1024 Listening on 0.0.0.0:3030, CTRL+C to stop

What can I do to only invoke it once?

lazyfrosch commented 10 years ago

You can start thin directly, then dashing will only be executed once

thin -R config.ru -p 3030 start

or with bundle

bundle exec thin -R config.ru -p 3030 start
pushmatrix commented 10 years ago

I noticed it too. Looking into it. This is new.

pushmatrix commented 10 years ago

Fixed it here https://github.com/Shopify/dashing/pull/366

pushmatrix commented 10 years ago

Thanks for pointing it out guys. Update to version 1.3.4 and you should be golden