diff options
author | Lunny Xiao <xiaolunwen@gmail.com> | 2018-10-26 17:37:57 +0800 |
---|---|---|
committer | Lauris BH <lauris@nix.lv> | 2018-10-26 12:37:57 +0300 |
commit | e7822473e90a668bb165ed2914dcb4eafc3c7ebd (patch) | |
tree | c1fef60bcc1f4a5209deccc7c46f37b25d6f848b /models/repo.go | |
parent | aeb5655c25053bdcd7eee94ea37df88468374162 (diff) | |
download | gitea-e7822473e90a668bb165ed2914dcb4eafc3c7ebd.tar.gz gitea-e7822473e90a668bb165ed2914dcb4eafc3c7ebd.zip |
Fix race on updatesize (#5190)
* fix race on updatesize
* fix more repoPath
Diffstat (limited to 'models/repo.go')
-rw-r--r-- | models/repo.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/models/repo.go b/models/repo.go index 61e1e26ae7..5a47812193 100644 --- a/models/repo.go +++ b/models/repo.go @@ -685,7 +685,7 @@ func (repo *Repository) IsOwnedBy(userID int64) bool { } func (repo *Repository) updateSize(e Engine) error { - repoInfoSize, err := git.GetRepoSize(repo.RepoPath()) + repoInfoSize, err := git.GetRepoSize(repo.repoPath(e)) if err != nil { return fmt.Errorf("UpdateSize: %v", err) } @@ -1713,7 +1713,7 @@ func updateRepository(e Engine, repo *Repository, visibilityChanged bool) (err e } // Create/Remove git-daemon-export-ok for git-daemon... - daemonExportFile := path.Join(repo.RepoPath(), `git-daemon-export-ok`) + daemonExportFile := path.Join(repo.repoPath(e), `git-daemon-export-ok`) if repo.IsPrivate && com.IsExist(daemonExportFile) { if err = os.Remove(daemonExportFile); err != nil { log.Error(4, "Failed to remove %s: %v", daemonExportFile, err) |