Skip to content

Commit

Permalink
Only clean up old remote directories
Browse files Browse the repository at this point in the history
Rather than unconditionally deleting the three oldest directories
(which can include directories still in use if there are several
builds running simultaneously).
  • Loading branch information
drasmuss committed Nov 15, 2022
1 parent 737b8b6 commit cde61ac
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ Release History
(it will look for any scripts in the same folder as the static script). (`#166`_)
- Black will now ignore excluded files even if that filename is passed directly
to black (e.g. when running through a precommit hook or IDE plugin). (`#161`_)
- Only delete remote build directories more than a day old. (`#172`_)

.. _#32: https://github.com/nengo/nengo-bones/pull/32
.. _#101: https://github.com/nengo/nengo-bones/pull/101
Expand Down
2 changes: 1 addition & 1 deletion nengo_bones/templates/remote.sh.template
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ EOF
flock -x -w 540 200 || exit 1
echo "$ Obtained cleanup lock"
{% block remote_cleanup %}
ls -tp | grep '{{ pkg }}-' | tail -n +3 | xargs -I {} rm -r -- {}
find . -mtime +1 -type d | grep '{{ pkg }}-' | xargs -I {} rm -r -- {}
{% endblock %}
) 200>cleanup.lock
exit \$?
Expand Down

0 comments on commit cde61ac

Please sign in to comment.