summaryrefslogtreecommitdiffstats
path: root/services/repository/archive.go
diff options
context:
space:
mode:
authorLunny Xiao <xiaolunwen@gmail.com>2021-11-16 21:30:11 +0800
committerGitHub <noreply@github.com>2021-11-16 21:30:11 +0800
commit48ccd325a1b81a58ac6d1d5d94fc4e90974599ea (patch)
treee7bb31d69343dd9845a1b0df013b093c8720f14b /services/repository/archive.go
parent447428f44659cee0e94e1c444f6291defac2bda2 (diff)
downloadgitea-48ccd325a1b81a58ac6d1d5d94fc4e90974599ea.tar.gz
gitea-48ccd325a1b81a58ac6d1d5d94fc4e90974599ea.zip
Move some functions into services/repository (#17660)
Diffstat (limited to 'services/repository/archive.go')
-rw-r--r--services/repository/archive.go20
1 files changed, 20 insertions, 0 deletions
diff --git a/services/repository/archive.go b/services/repository/archive.go
new file mode 100644
index 0000000000..bea636c579
--- /dev/null
+++ b/services/repository/archive.go
@@ -0,0 +1,20 @@
+// Copyright 2021 The Gitea Authors. All rights reserved.
+// Use of this source code is governed by a MIT-style
+// license that can be found in the LICENSE file.
+
+package repository
+
+import (
+ "context"
+
+ "code.gitea.io/gitea/models"
+ "code.gitea.io/gitea/modules/storage"
+)
+
+// DeleteRepositoryArchives deletes all repositories' archives.
+func DeleteRepositoryArchives(ctx context.Context) error {
+ if err := models.DeleteAllRepoArchives(); err != nil {
+ return err
+ }
+ return storage.Clean(storage.RepoArchives)
+}