Replies: 1 comment
-
Files in The distinction is not made by looking at the file path but rather how you call it ( The real problem are your multiple instances. There is no way around using sticky sessions. And data uploaded to one instance must also be made available to the other (not only on file system level but also to NiceGUI so the routing is known to the instance). |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Question
Hello there, 🙂
A site I'm working on started gaining some traction and I've been noticing some error logs quite frequently along the lines of:
This is similar to another discussion (#3394), except I'm using Railway instead of fly.io, but they're fairly similar in the sense that they're both hosting services that allow for multiple instances.
Since I needed this to work as soon as possible, I just moved a bunch of files to my
media/
path and I noticed that the same errors persisted, but for some reason the files that I had defined usingapp.add_media_files
were being served as static.For example:
When I open each respective element in a new tab to see the result URL this is what I found:
http://127.0.0.1:8080/_nicegui/auto/static/371e48856c573dabe891adee0afce452/chicken.jpg
http://127.0.0.1:8080/_nicegui/auto/media/307462da0644e0832bf9e14573f84d51/dog.webm
Despite only using
ui.add_media_files
and notui.add_static_files
, thechicken.jpg
file is being served from/_nicegui/auto/static/
and thedog.webm
file is being served from/_nicegui/auto/media/
.Alternatively, I tried to add each file individually like so, but the result is still the same:
Is this intended? Such behavior is not mentioned in the docs. I am aware that this is not exactly the right approach to fix my real issue, since I should be serving small files as static, but I wanted to discuss what I noticed.
Thank you for reading. 😁
Beta Was this translation helpful? Give feedback.
All reactions