Closed btsimonh closed 1 month ago
@Jason2866 - pls comment on the use of yield in file listing.
yield does give the core time "doing needed" things and resets the WDT. So probably a good idea :-) What I do not like very much is the left debug code. Either you think it is needed so keep it active (maybe change to more debug) or remove it completely.
Looks good to me. Ok to merge
@Jason2866 - point taken. none of it is active, as it's all hashed out.
Description:
Related issue (if applicable): fixes #21473
This changes the rarely used UFSServe code enabled by
#ifdef UFILESYS_STATIC_SERVING
to be like the file download code.For me, this makes the file serving much more reliable on slower devices like the ESP Chip Id 3667140 (ESP32-D0WDQ6 v1.0)
Prior to this change, I would see a random main loop hang on accessing files.
I have tested with >5000 file downloads on ESP32S3 and >1500 downloads on esp32cam (ai thinker style), and had better results. I don't think this is a complete fix, as I have had one device lose connection (unfortunately without serial) - but this could have been something else.
This PR also adds yield() in file list from the GUI. This is tested and does not cause a watchdog on a 1500 file folder. (the main thread is hung during this time - many seconds). I'm not sure if there can be a better solution whilst the webserver can handle a single client. One would be a re-write of the JS to poll for more files - but this may not help as even finding files in a large folder takes a lot of time. Having this many files in a folder on an IOT device seems unusual, so it may be better to document and live with it.
Checklist:
NOTE: The code change must pass CI tests. Your PR cannot be merged unless tests pass