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

Add options to change reload interval and ignore sys.modules #16

Open
AdamG opened this issue Aug 30, 2010 · 1 comment
Open

Add options to change reload interval and ignore sys.modules #16

AdamG opened this issue Aug 30, 2010 · 1 comment

Comments

@AdamG
Copy link

AdamG commented Aug 30, 2010

sha: 50e8347

I'm not quite happy with this change - it seems to me that watching sys.modules should be a default-true option of its own - but it maintains backwards compatibility while allowing the use case that I needed - watching a particular file while ignoring sys.modules.

The reason for not watching sys.modules is just to avoid len(sys.modules) * child processes * num spawning instances stat calls every second. --reload-interval has the same purpose.

@AdamG
Copy link
Author

AdamG commented Apr 27, 2011

The original commit is way out of date now, especially with the source-dir-renaming thing. Here's an updated patch:

http://static.gomaa.us/adam/patches/spawning-2011-04-27-watch-single-file.patch

It removes the passing of --reload to children, since that was ignored by the spawning_child code. Instead, watching sys.modules only happens if you pass --reload=dev. If you pass only --watch=whatever, only that file is watched (currently, sys.modules would be watched as well). Both reload and watch can be used to get the current sys.modules + watched file behavior.

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

1 participant