rerun issue on a dashboard using dash from plotly - plotly-dash

I have a problem with dash, in which the dash.py file is executed over and over again instead of once and making the callbacks on the first execution. My problem is that I have a file that takes about a minute to run, but if it reruns every time I refresh the dashboard or every time it refreshes, it keeps loading.
So I can't see it because it doesn't stop loading
I have not known what to change

Related

How to prevent browser from loading js from memory cache by range?

I opened my website in Chrome last night, then closed that tab, but didn't close browser. Today I failed to open my site in a new tab because jQuery(not use CDN) hits a syntax error: unexpected end of input.
My site always hits this error no matter how many times I refresh. But the error didn't happen again after hard refresh.
This problem happens many times in recent months.
I checked Chrome devtool, it says my jquery.min.js is loaded from memory cache. And it is not a whole file, only contains part of jquery library. That's why I got syntax error.
I did some research from google:
The lifetime of memory cache is attach to the lifetime of render process, which roughly corresponds to a tab.
So if I create a new tab to visit my site, stands to reason, jQuery should not be loaded from memory cache.
I expect browser do not load my files from memory again if I visit site in new tab.
Is there anything I can do to locate the problem source and fix it?
EDIT (2019-05-13):
Today hit this error again, but fortunately, I found new point seems helpful to this problem.
This is that request:
See status code is 206 Partial Content (from memory cache).
And I have no idea why my request header contains 'Range' field.
You can't detect newtab in browser and load your jquery.min.js,But you can avoid loading from cache by adding timestamp into suffix of your lib like follows.
http://yoursite.com/lib/js/jquery.min.js?1557301884
You can achieve this in two ways
Case:1 If you are using server side page rendering means(PHP,JSP) just print the timestamp
Case:2 If Client side means some javascript stuff you have to do

Node/Express server hangs intermittently but automatically continues after a pause

Unfortunately I cannot put the code here because despite all kinds of debugging I cannot point to the problem to present the problematic segment of the code. If I try to load a HTML which in turn has other requests (js,css,png, etc.), it loads all except one... The server/browser hangs for some time and then after about a minute or so does actually load! If I try to test the server with individual manual requests of these very URLs in the HTML file, it works fine.
While tying to load the HTML file, Chrome Network tab shows "pending..." of one request or sometimes two. But ultimately all the URLs requested are served. Thats what bugs me...
I tried to set http.globalAgent.maxSockets to 100 as suggested here as the HTML file would make more than 8 requests for the different js, css, etc. This did not help either.
I have reached a deadend. Any help would be appreciated.

Node.js/Express 4 - How to update a page to show progress in workflow

i built a small page to track a workflow with multiple steps. The page contains a form with submit button to start the flow. Each step sends back a status to the page. The page html is rerendered with res.render() then and sent to the server with res.send(html).
My problem now is, that when i use res.send(), the next status update gives a failure, because the response process is finished before.
Using res.write() instead crashes the page for whatever reason. I looks like the page is appended a second time (from a buffer??), instead of overwriting it.
Any ideas how to solve that??
Moe

Google Maps Data Layer: loading a second file using map.data.loadGeoJson much slower

I am writing an application that displays zipcode, and other layers on a google map. For the zipcodes I have a simplified geojson file for the upper zoom levels and a more detailed database of features that get added when zoomed in. This works fine on the first load. The map loads at a high zoom level and loads the simplified geojson in ~10 second. However after I zoom in then zoom back out the reload of the simplified geojson takes ~30 second. This is after clearing all previous data with
map.data.forEach(function(feature) {map.data.remove(feature); });
At first I believed this to be a memory leak issue cause by something else in my code, so I did a simple test where I created a map that just loaded the simplified file, cleared it then loaded it again, and I get the same result of about 3 times load time. I then created a much smaller geojson file with just 3 zipcode boundaries, and did a test where I loaded that tiny file, cleared it then loaded the simplified file and the load takes almost as long ~30 seconds. So it would seem that the simple act of loading a second file causes some sort of extra processing need within Google maps. I have even tried loading the new file in a new layer with
high_zoom_zips = new google.maps.Data({map: map})
high_zoom_zips.loadGeoJson('zips.json');
however the longer load time remains. Reloading it a third or forth time do not seems to increase the load time significantly
Has anyone else run into this problem? is there a need to reset anything else within Google maps to prevent this extra processing?

How to delay MainPage, so it starts after data is loaded?

I have an application that stores data in isolated storage. I have a function to read the data (called in Apps.xaml.cs):
await ReadData();
However, before the data read, OnNavigatedTo is called in MainPage. At that point the buffer holding the data is still null.
How can I prevent MainPage.OnNavigateTo() from being as long as ReadData is not complete?
I tried syncing Apps & MainPage by setting a semaphore in Apps, and WaitOne() in the MainPage constructor. This hang the app on the WaitOne.
Any idea how this timing problem can be solved?
You can't delay the loading of the main page - as if the loading cycle is not executed within a timely fashion the app will be closed by the OS.
The best way around this is to create an interim splash page, which will handle the downloading of data whilst showing UI to the user. Once the data has downloaded you can then redirect to your main application page.