-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Community Feedback #6
Comments
One thing I sometimes stumble upon is the problem, that if I integrate This causes the reload to happen before the server is running and every so often this means, because the server was not up quick enough, that I see the
page. Maybe a combination of I think there would be several possible ways of solving this, i.e. retrying within I am happy to do the work, but I wouldn't start implementing such a feature, without checking first that I did not miss something obvious and second, whether it is in line with your vision for the project. |
Penguin should already be able to deal with that: penguin/lib/src/serve/proxy.rs Lines 406 to 440 in 406fde0
The code also looks like the "failed to connect to proxy target" page is served, but another "reload" command is sent once the proxy target is available again. Maybe that's not ideal. Mhhh I regularly use Penguin in the situation you described. I just dug up the script used there and it looks like I do some manual check: The important part of this bash script is: reload_once_port_is_open() {
while ! lsof -i:3080 > /dev/null; do
sleep 0.1
done
penguin reload
}
cargo build || exit 1
reload_once_port_is_open &
./target/debug/tobira serve The last line starts the server. So mh. I agree that this should probably not be necessary, but somehow built into Penguin. Will think about it. Maybe just a simple |
I just checked and indeed, when I run I can even see the reload being triggered in the logs:
But the page does not reload.
That does actually sound pretty clever, simple and useful :) The only problem I can see with that is that the Ideally the reload request would have the option to make the server wait for the proxy target to appear, with a configurable timeout. Then Maybe it is as simple as swallowing the reload if the proxy target is not available and relying on the logic you have send, to reload once the target is available. I do agree that delaying the refresh is a much better UX than waiting in the request for the proxied service (especially if I manually reload I can then see that the target is not available). |
BTW: Just tried out your suggested script and as expected it does work perfectly and solves the problem. Thanks again for your prompt help! Appreciate it very much! |
Do you have any opinions, complaints, suggestions, ideas, ... about this project? Let me know! This issue is less formal and more relaxed than "normal issues", so feel free to just dump your thoughts here.
The text was updated successfully, but these errors were encountered: