Skip to content

Auto Reload on File Changes#44

Merged
jurasofish merged 13 commits intomainfrom
auto_reload
Mar 2, 2025
Merged

Auto Reload on File Changes#44
jurasofish merged 13 commits intomainfrom
auto_reload

Conversation

@jurasofish
Copy link
Owner

@jurasofish jurasofish commented Mar 2, 2025

Closes #38

This is a fairly simple implementation where watchdog is used to watch for changes on the filesystem. Each change is appended to a 'pending refresh' list. And every 100ms (by default) the code refreshes them in bulk. This 100ms interval allows things to accumulate, thus allowing for sensible multiprocessing. And it avoids things like where IDEs create temporary files (pycharm seems to do this on save).

It's quite possibly a bit racy. I haven't intended to make it bullet proof, and can always do a second pass on it.

@jurasofish jurasofish merged commit 1dd6bab into main Mar 2, 2025
20 checks passed
@jurasofish jurasofish deleted the auto_reload branch March 2, 2025 05:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Auto-reload / watch files

1 participant