Skip to content

Implement archive cleanup#885

Merged
lunny merged 5 commits into
go-gitea:masterfrom
minecrafter:archive-cleanup
Feb 11, 2017
Merged

Implement archive cleanup#885
lunny merged 5 commits into
go-gitea:masterfrom
minecrafter:archive-cleanup

Conversation

@minecrafter
Copy link
Copy Markdown
Contributor

Fixes #769.

This allows Gitea to automatically purge created archives in order to better control disk space usage. Currently, archives older than 24 hours will be purged every 24 hours.

Fixes go-gitea#769

Signed-off-by: Andrew <write@imaginarycode.com>
@lunny lunny added this to the 1.1.0 milestone Feb 10, 2017
Comment thread models/repo.go Outdated

for _, ty := range []string{"zip", "targz"} {
path := filepath.Join(basePath, ty)
file, err := os.Open(path)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

file is not close

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed.

@lunny lunny added the type/feature Completely new functionality. Can only be merged if feature freeze is not active. label Feb 10, 2017
@lunny
Copy link
Copy Markdown
Member

lunny commented Feb 10, 2017

LGTM

@tboerger tboerger added the lgtm/need 1 This PR needs approval from one additional maintainer to be merged. label Feb 10, 2017
Copy link
Copy Markdown
Member

@strk strk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM - please also update documentation (ini cheatsheet)

Comment thread models/repo.go Outdated
for _, info := range files {
if info.ModTime().Before(minimumOldestTime) && !info.IsDir() {
toDelete := filepath.Join(path, info.Name())
// This is a best-effort purge, so we do not check error codes to confirm removal.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd still trace-print any error (could be something a sysadmin could fix...)

Comment thread models/repo.go Outdated
if err := x.
Where("id > 0").
Iterate(new(Repository),
func(idx int, bean interface{}) error {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could this be defined as a standalone function, for better readability ?

@strk
Copy link
Copy Markdown
Member

strk commented Feb 10, 2017

As my review wasn't immediately recognized by the bot, I'll take the chance to ask you to deal with the two comments I've added before convincing the bot :)

@strk
Copy link
Copy Markdown
Member

strk commented Feb 10, 2017

LGTM now - although I don't know how cheatsheet is generated

@tboerger tboerger added lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. and removed lgtm/need 1 This PR needs approval from one additional maintainer to be merged. labels Feb 10, 2017
@lunny lunny merged commit 42835c7 into go-gitea:master Feb 11, 2017
@go-gitea go-gitea locked and limited conversation to collaborators Nov 23, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. type/feature Completely new functionality. Can only be merged if feature freeze is not active.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Cached repository archives grow space occupation indefinitevely

4 participants