# 下载缓存 bug 卷土重来

**URL:** <https://meta.discourse.org/t/download-cache-bug-strikes-back/91228>\
**Category:** Bug\
**Created:** [2018年六月29日 20:33 UTC](https://meta.discourse.org/t/download-cache-bug-strikes-back/91228 "2018-06-29T20:33:20Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![RGJ](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/rgj/32/523185_2.png) [@RGJ](https://meta.discourse.org/u/RGJ)\
**Post date:** [2018年六月29日 20:33 UTC](https://meta.discourse.org/t/download-cache-bug-strikes-back/91228/1 "2018-06-29T20:33:20Z")

</div>

The download\_cache removal code turns out not to be working again (or: still)

Older bug report including fix [here](https://meta.discourse.org/t/download-cache-bug/68296).

The file selection works fine now, but the xargs rm -f does not.  
Since the code is not entering the `download_cache` directory first, it’s trying to remove those files somewhere else.

So I guess it should be something like

`ls -tr #{CACHE_DIR} | head -n -#{CACHE_MAXIMUM_SIZE} | awk '$0="#{CACHE_DIR}/"$0'| xargs rm -f`

---

<div class="post-metadata">

**Author:** ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)\
**Post date:** [2018年六月29日 21:19 UTC](https://meta.discourse.org/t/download-cache-bug-strikes-back/91228/2 "2018-06-29T21:19:46Z")

</div>

Maybe @zogstrip can look again when he is back?

---

<div class="post-metadata">

**Author:** ![zogstrip](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/zogstrip/32/512781_2.png) [@zogstrip](https://meta.discourse.org/u/zogstrip)\
**Post date:** [2018年七月4日 16:19 UTC](https://meta.discourse.org/t/download-cache-bug-strikes-back/91228/4 "2018-07-04T16:19:43Z")

</div>

Thanks for reporting this issue 👍

[https://github.com/discourse/discourse/commit/448e2fe1a2126a690cf0ddd442cb8dc16a2167f5](https://github.com/discourse/discourse/commit/448e2fe1a2126a690cf0ddd442cb8dc16a2167f5)

---

<div class="post-metadata">

**Author:** ![zogstrip](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/zogstrip/32/512781_2.png) [@zogstrip](https://meta.discourse.org/u/zogstrip)\
**Post date:** [2018年七月5日 16:00 UTC](https://meta.discourse.org/t/download-cache-bug-strikes-back/91228/5 "2018-07-05T16:00:01Z")

</div>

This topic was automatically closed after 23 hours. New replies are no longer allowed.
