MCPcopy Create free account
hub / github.com/gogs/gogs / DeleteRepositoryArchives

Function DeleteRepositoryArchives

internal/database/repo.go:1975–1987  ·  view source on GitHub ↗

DeleteRepositoryArchives deletes all repositories' archives.

()

Source from the content-addressed store, hash-verified

1973
1974// DeleteRepositoryArchives deletes all repositories' archives.
1975func DeleteRepositoryArchives() error {
1976 if taskStatusTable.IsRunning(taskNameCleanOldArchives) {
1977 return nil
1978 }
1979 taskStatusTable.Start(taskNameCleanOldArchives)
1980 defer taskStatusTable.Stop(taskNameCleanOldArchives)
1981
1982 return x.Where("id > 0").Iterate(new(Repository),
1983 func(idx int, bean any) error {
1984 repo := bean.(*Repository)
1985 return os.RemoveAll(filepath.Join(repo.RepoPath(), "archives"))
1986 })
1987}
1988
1989func gatherMissingRepoRecords() ([]*Repository, error) {
1990 repos := make([]*Repository, 0, 10)

Callers 1

OperationFunction · 0.92

Calls 6

IsRunningMethod · 0.80
StopMethod · 0.80
IterateMethod · 0.80
WhereMethod · 0.80
RepoPathMethod · 0.80
StartMethod · 0.45

Tested by

no test coverage detected