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
Support static assets where file length may change, e.g. logs #1640
Comments
Hah, this is certainly unexpected. It looks like this is the code in question: datasette/datasette/utils/asgi.py Lines 259 to 266 in a6ff123
You're right: it assumes that the file it is serving won't change length while it is serving it. |
The reason I implemented it like this was to support things like the Here's the code that hooks it up to the URL resolver: Lines 1001 to 1005 in 458f03a
Which uses this function: datasette/datasette/utils/asgi.py Lines 285 to 310 in a6ff123
One option here would be to support a workaround that looks something like this:
The URL routing code could then look out for that It's a bit of a cludge, but it would be pretty straight-forward to implement. Would that work for you @broccolihighkicks? |
This is a bit of an oxymoron.
I am serving a log.txt file for a background process using the Datasette --static CLI. This is useful as I can observe a background process from the web UI to see any errors that occur (instead of spelunking the logs via docker exec/ssh etc).
I get this error, which I think is because Datasette assumes that the size of the content does not change (but appending new log lines means the content length changes).
Thanks, I am finding Datasette very useful.
The text was updated successfully, but these errors were encountered: