gottfrois / dashing-rails

The exceptionally handsome dashboard framework for Rails.
MIT License
1.45k stars 149 forks source link

Load data when site loads #84

Closed holgersindbaek closed 8 years ago

holgersindbaek commented 8 years ago

Is this possible?

We have one dashboard in the office and I've set it to run the jobs every 5 minutes. We need to be able to go into the website from home and see the data though. How can I make the data load as soon as you go into the website, so I don't have to wait 5 minutes before I can see the data?

gottfrois commented 8 years ago

When someone loads the dashboard in their browser, all widgets will automatically receive the last values that the job server fetched -- you shouldn't need to tell the job to re-run.

Is this behaviour not showing for you?

You might want to look at https://github.com/Shopify/dashing issues if this is the case.

holgersindbaek commented 8 years ago

No... I have to wait until the next push occurs. Is it the "first_in: 0" that should make sure it runs when someone enters the site? Or does the latest information get saved somewhere somehow?!

gottfrois commented 8 years ago

I don't think it's first_in option. It's just there to tell the job to starts right away.

Might be an issue on frond-end side. I would need to upgrade to last version maybe.

holgersindbaek commented 8 years ago

It's weird. I ended up making a gross hack. I call a function from the main dashing jQuery file, that runs all the jobs again. So the jobs get run now on load. Couldn't get it to work otherwise.

gottfrois commented 8 years ago

Upgrading to dashing-rails 2.5.0 should now fix your issue