Skip to content

Commit

Permalink
Update nuke_if_too_big documentation (#17429)
Browse files Browse the repository at this point in the history
* Increased size of `.cache/pants/setup` path

This path is now typically larger than 256mb.

* Fixed nuke_if_too_big shellcheck
  • Loading branch information
xlevus authored Nov 2, 2022
1 parent b0ba952 commit 971dc4c
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions docs/markdown/Using Pants/using-pants-in-ci.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,17 +39,17 @@ See [Troubleshooting](doc:troubleshooting#how-to-change-your-cache-directory) fo
> You can use this script to nuke the cache when it gets too big:
>
> ```bash
> function nuke_if_too_big() {
> path=$1
> limit_mb=$2
> size_mb=$(du -m -d0 ${path} | cut -f 1)
> if (( ${size_mb} > ${limit_mb} )); then
> echo "${path} is too large (${size_mb}mb), nuking it."
> rm -rf ${path}
> fi
> }
> function nuke_if_too_big() {
> path=$1
> limit_mb=$2
> size_mb=$(du -m -d0 "${path}" | cut -f 1)
> if (( size_mb > limit_mb )); then
> echo "${path} is too large (${size_mb}mb), nuking it."
> rm -rf "${path}"
> fi
> }
>
> nuke_if_too_big ~/.cache/pants/setup 256
> nuke_if_too_big ~/.cache/pants/setup 512
> nuke_if_too_big ~/.cache/pants/named_caches 1024
> ```
Expand Down

0 comments on commit 971dc4c

Please sign in to comment.