Skip to content

Commit

Permalink
Make pushUpdate error verbose (go-gitea#28263)
Browse files Browse the repository at this point in the history
- Push commits updates are run in a queue and updates can come from less
traceable places such as Git over SSH, therefor add more information
about on which repository the pushUpdate failed.

Refs: https://codeberg.org/forgejo/forgejo/pulls/1723

(cherry picked from commit 37ab9460394800678d2208fed718e719d7a5d96f)

Co-authored-by: Gusted <postmaster@gusted.xyz>
  • Loading branch information
2 people authored and pangliang committed Dec 5, 2023
1 parent 5561213 commit 1248a56
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion services/repository/push.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,9 @@ var pushQueue *queue.WorkerPoolQueue[[]*repo_module.PushUpdateOptions]
func handler(items ...[]*repo_module.PushUpdateOptions) [][]*repo_module.PushUpdateOptions {
for _, opts := range items {
if err := pushUpdates(opts); err != nil {
log.Error("pushUpdate failed: %v", err)
// Username and repository stays the same between items in opts.
pushUpdate := opts[0]
log.Error("pushUpdate[%s/%s] failed: %v", pushUpdate.RepoUserName, pushUpdate.RepoName, err)
}
}
return nil
Expand Down

0 comments on commit 1248a56

Please sign in to comment.