provision: Run clean-unused-caches.

This prevents the caches in /srv from growing to fill up the disk --
e.g., on my laptop after 6 months of regular development the venv cache
was 12G and the NPM cache 5G, making them by far the largest disk hogs
on the machine.

It costs about 0.4s, apart from any time spent actually removing
things.  This is a little annoyingly slow to be adding to every
provision, and seems like it could be optimized, but I think already
worth it as is.
This commit is contained in:
Greg Price 2017-11-18 12:57:08 -08:00 committed by Tim Abbott
parent a6510c4626
commit 13aa23eb40
1 changed files with 2 additions and 0 deletions

View File

@ -371,6 +371,8 @@ def main(options):
else:
print("No need to run `manage.py compilemessages`.")
run(["scripts/lib/clean-unused-caches"])
version_file = os.path.join(UUID_VAR_PATH, 'provision_version')
print('writing to %s\n' % (version_file,))
open(version_file, 'w').write(PROVISION_VERSION + '\n')