Skip to content
This repository has been archived by the owner on Jan 8, 2025. It is now read-only.

the server is not able to find generated files until server restart #42

Open
mtboss124 opened this issue Oct 4, 2024 · 10 comments
Open

Comments

@mtboss124
Copy link

any way to call a server update??

@mtboss124
Copy link
Author

the issue is that, the server gives 404 when requested the generated file even if its there.
It only reads the file once the server is restarted

@pbsds
Copy link
Owner

pbsds commented Oct 4, 2024

this is run on boot

https://github.com/pbsds/hatena-server/blob/master/hatena.py#L166

@mtboss124
Copy link
Author

Didn't catch that line, mb.

Will test updating it manually every time an ugomenu generates and post the results in a few hours when i get on pc

@mtboss124
Copy link
Author

called the function after importing from hatena.py after some tests no problems happend.
Thanks!!!

@mtboss124
Copy link
Author

turns out the files where cached and it wasnt updating the files
using this to update the code whenever it makes a request
image

defined here (or imported)
image
it dosent give any errors but its still giving 404 until server restart

@mtboss124 mtboss124 reopened this Oct 4, 2024
@pbsds
Copy link
Owner

pbsds commented Oct 6, 2024

you may have to implement some getChild logic to dynamically traverse the files tree

@mtboss124
Copy link
Author

I see. i will try to implement it in the near future.
Ill have to read more python stuff and see if can make it

@mtboss124
Copy link
Author

even tho the code traverses the files and lists them in the console it refuses to update till the server restarts
i have been trying, but i cant get it to work.
maybe its possible to not serve static files to begin with??? (i am very unexpirienced with protocols)

@pbsds
Copy link
Owner

pbsds commented Oct 13, 2024

how Twisted works is that each file or folder is represented with a class/object. Instead of attaching children to the root object at startup, you can override the getChild methods to do the traversal at the time a request happens.

@pbsds
Copy link
Owner

pbsds commented Oct 13, 2024

that is for example what happens here

https://github.com/pbsds/hatena-server/blob/master/hatena.py#L53C6-L53C14

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants