aboutsummaryrefslogtreecommitdiff
path: root/models/action.go
diff options
context:
space:
mode:
Diffstat (limited to 'models/action.go')
-rw-r--r--models/action.go11
1 files changed, 9 insertions, 2 deletions
diff --git a/models/action.go b/models/action.go
index 11749293..44d7aea8 100644
--- a/models/action.go
+++ b/models/action.go
@@ -59,14 +59,18 @@ func (a Action) GetContent() string {
// CommitRepoAction records action for commit repository.
func CommitRepoAction(userId int64, userName string,
repoId int64, repoName string, refName string, commits *base.PushCommits) error {
+ log.Trace("action.CommitRepoAction: %d/%s", userId, repoName)
+
bs, err := json.Marshal(commits)
if err != nil {
+ log.Error("action.CommitRepoAction(json): %d/%s", userId, repoName)
return err
}
// Add feeds for user self and all watchers.
watches, err := GetWatches(repoId)
if err != nil {
+ log.Error("action.CommitRepoAction(get watches): %d/%s", userId, repoName)
return err
}
watches = append(watches, Watch{UserId: userId})
@@ -86,20 +90,23 @@ func CommitRepoAction(userId int64, userName string,
RepoName: repoName,
RefName: refName,
})
+ if err != nil {
+ log.Error("action.CommitRepoAction(notify watches): %d/%s", userId, repoName)
+ }
return err
}
// Update repository last update time.
repo, err := GetRepositoryByName(userId, repoName)
if err != nil {
+ log.Error("action.CommitRepoAction(GetRepositoryByName): %d/%s", userId, repoName)
return err
}
repo.IsBare = false
if err = UpdateRepository(repo); err != nil {
+ log.Error("action.CommitRepoAction(UpdateRepository): %d/%s", userId, repoName)
return err
}
-
- log.Trace("action.CommitRepoAction: %d/%s", userId, repo.LowerName)
return nil
}