diff options
author | Lunny Xiao <xiaolunwen@gmail.com> | 2019-07-16 08:13:03 +0800 |
---|---|---|
committer | techknowlogick <techknowlogick@gitea.io> | 2019-07-15 20:13:03 -0400 |
commit | d2958d9f4633ddbde2202952d665b3d562eb0415 (patch) | |
tree | 59f6d1c0ed6c886ba0caa6d96d5a175debf376b7 /models/repo.go | |
parent | 760c47389696e97131a3d13629a0a5a4576e5283 (diff) | |
download | gitea-d2958d9f4633ddbde2202952d665b3d562eb0415.tar.gz gitea-d2958d9f4633ddbde2202952d665b3d562eb0415.zip |
Move status table to cron package (#7370)
Diffstat (limited to 'models/repo.go')
-rw-r--r-- | models/repo.go | 25 |
1 files changed, 0 insertions, 25 deletions
diff --git a/models/repo.go b/models/repo.go index 9bedeba952..fc5f81eb5c 100644 --- a/models/repo.go +++ b/models/repo.go @@ -2056,11 +2056,6 @@ func DeleteRepositoryArchives() error { // DeleteOldRepositoryArchives deletes old repository archives. func DeleteOldRepositoryArchives() { - if !taskStatusTable.StartIfNotRunning(archiveCleanup) { - return - } - defer taskStatusTable.Stop(archiveCleanup) - log.Trace("Doing: ArchiveCleanup") if err := x.Where("id > 0").Iterate(new(Repository), deleteOldRepositoryArchives); err != nil { @@ -2187,23 +2182,8 @@ func SyncRepositoryHooks() error { }) } -// Prevent duplicate running tasks. -var taskStatusTable = sync.NewStatusTable() - -const ( - mirrorUpdate = "mirror_update" - gitFsck = "git_fsck" - checkRepos = "check_repos" - archiveCleanup = "archive_cleanup" -) - // GitFsck calls 'git fsck' to check repository health. func GitFsck() { - if !taskStatusTable.StartIfNotRunning(gitFsck) { - return - } - defer taskStatusTable.Stop(gitFsck) - log.Trace("Doing: GitFsck") if err := x. @@ -2272,11 +2252,6 @@ func repoStatsCheck(checker *repoChecker) { // CheckRepoStats checks the repository stats func CheckRepoStats() { - if !taskStatusTable.StartIfNotRunning(checkRepos) { - return - } - defer taskStatusTable.Stop(checkRepos) - log.Trace("Doing: CheckRepoStats") checkers := []*repoChecker{ |