gottfrois / dashing-rails

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

How to stop dashing-rails web app auto reload #82

Open muhammadusmanarshad opened 8 years ago

muhammadusmanarshad commented 8 years ago

I have web app using dashing-rails but my app auto reload after sometime. Is there anyway to stop auto reloading?

gottfrois commented 8 years ago

What do you mean auto-reload? automatic refresh on the browser?

muhammadusmanarshad commented 8 years ago

yes, my browser automatic refresh after every 5 min. Is there anyway we can stop this?

gottfrois commented 8 years ago

The only place I see we do a refresh is here https://github.com/gottfrois/dashing-rails/blob/master/vendor/assets/javascripts/dashing/dashing-src.coffee#L107

But it's supposed to happen because of a connection error. Is it your case?

muhammadusmanarshad commented 8 years ago

Yes this my case, and I don't want this thing. Is there anyway to stop this?

gottfrois commented 8 years ago

It means you have issues connecting to the event source. Don't you want to fix that instead ? :)

muhammadusmanarshad commented 8 years ago

:) My app is such that, these errors occur mostly but not effect my app performance, That's y i need to stop this. :)

gottfrois commented 8 years ago

Fork and try to remove those lines https://github.com/gottfrois/dashing-rails/blob/master/vendor/assets/javascripts/dashing/dashing-src.coffee#L105-L107

There are no way to configure this at this point

holgersindbaek commented 8 years ago

@gottfrois @muhammadusmanarshad I'm having this same issue. As far as I can read on the code you pointed to, it's related to the connection being lost.

I'm using Mongoid, so I haven't been able to ad the code in the following file "config/initializers/database_connection.rb". Could that have something to do with it?

It seems to be only happening on Heroku in production. Do I need to upgrade the web or worker you think?

gottfrois commented 8 years ago

The code in config/initializers/database_connection.rb is ActiveRecord related. You might want to search if there is any equivalents for MongoDB but it's database related anyway.

It seems that you guys are having issues with the websocket connection dropping out, which cause a browser refresh. I am not an expert with EventSource library so I would first start looking at https://github.com/Shopify/dashing to see if there are similar issues. I did not upgrade dashing-rails with dashing latest JS code recently.

holgersindbaek commented 8 years ago

@gottfrois Which version of Dashing Rails are you using then?

I'm still not sure how the database connection file relates to dashing in any way, dashing is not saving anything in the database, right?!

gottfrois commented 8 years ago

No it's not persisting anything in database. But dashing-rails is just an engine which is likely to be installed on a rails application running a database. But I don't think your issue is related to database connection issue with dashing-rails.

holgersindbaek commented 8 years ago

Ok. Thanks for clarifying.