1
0
mirror of https://github.com/haiwen/seafile-server.git synced 2025-09-01 23:46:53 +00:00

send event (#490)

* send event

* send event
This commit is contained in:
Xiangyue Cai
2021-09-17 11:07:38 +08:00
committed by GitHub
parent 7f09cff78c
commit 88e917c58e
4 changed files with 75 additions and 18 deletions

View File

@@ -321,24 +321,12 @@ func editRepoNeedRetry(repoID, name, desc, user string) (bool, error) {
return false, err
}
err = updateBranch(repoID, commit.CommitID, parent.CommitID)
err = updateBranch(repoID, commit.CommitID, parent.CommitID, "")
if err != nil {
return true, nil
}
updateRepoInfo(repoID, commit.CommitID)
repomgr.UpdateRepoInfo(repoID, commit.CommitID)
return true, nil
}
func updateRepoInfo(repoID, commitID string) error {
head, err := commitmgr.Load(repoID, commitID)
if err != nil {
err := fmt.Errorf("failed to get commit %s:%s", repoID, commitID)
return err
}
repomgr.SetRepoCommitToDb(repoID, head.RepoName, head.Ctime, head.Version, head.Encrypted, head.CreatorName)
return nil
}