anatol / pacoloco

Caching proxy server for Arch Linux pacman
MIT License
216 stars 30 forks source link

Make purge optional #23

Closed aude closed 3 years ago

aude commented 3 years ago

Hi!

I've been thinking about a tool like this for a while, and decided to look today if anybody else had been thinking about the same. Turns out you had!

I'd like to never purge though, I like to keep packages around forever as a way of practicing unhealthy hoarding. So I thought I'd have a go at making purge optional.

This PR just makes purge_files_after optional, and adds tests to config_test.go :ok_hand:

aude commented 3 years ago

I'm working on this as a part of doing Hacktoberfest, it would be awesome if you added the hacktoberfest-accepted label to this PR. (reason)

anatol commented 3 years ago

Thanks a lot! The changes look good. I've pulled the first one into master.

For the second commit I think it would make sense to split it into two: 1) parse config cleanup/test 2) disable files purging

For 2) could you please also document this behavior in README.md?

aude commented 3 years ago

Thanks for the feedback, good idea to split the last commit.

I've updated the PR, how does it look?

anatol commented 3 years ago

Thanks, the changes look good.

The default purging period has changed from 30 days to never. But I think it is ok. We can put the old value to the sample config.yml and let the end user to modify it if its needed.

I updated commit message for the second commit, specified the default timeout value and merged the commit.

Thank you for your work!