AssertionError when reloading the page #477
-
When running the following script #!/usr/bin/env python3
import justpy as jp
wp = jp.WebPage()
wp.add(jp.Div(text='Hello, world!'))
jp.justpy(lambda: wp) and reloading the page twice, I get a 500 Server Error and the following traceback:
Could it have something to do with #354? Tested with Chrome or Firefox on 02e3d9f |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments
-
I am in favor of making the old behavior optional which shouldn't be to much work since the reloading now is in function reload_site() {
if (!reload_started) {
console.log("Reloading site...");
reload_started = true;
setTimeout(try_reload_site, reload_timeout);
}
} versus
|
Beta Was this translation helpful? Give feedback.
-
Apparently this behavior is not new. JustPy doesn't seem to like reusing |
Beta Was this translation helpful? Give feedback.
-
The reason for that is that justpy would not scale if the memory needed to hold each WebPage on the server were not reclaimed when the page in the browser is closed. If you don't want the wp object deleted when the browser page is closed use the delete_flag: import justpy as jp
wp = jp.WebPage(delete_flag=False)
wp.add(jp.Div(text='Hello, world!'))
jp.justpy(lambda: wp) |
Beta Was this translation helpful? Give feedback.
The reason for that is that justpy would not scale if the memory needed to hold each WebPage on the server were not reclaimed when the page in the browser is closed.
If you don't want the wp object deleted when the browser page is closed use the delete_flag: