From 1bfcdeef4cca0f5509476358e5931c13d37ed1ca Mon Sep 17 00:00:00 2001 From: Earl Warren <109468362+earl-warren@users.noreply.github.com> Date: Thu, 30 Nov 2023 01:46:51 +0100 Subject: [PATCH] Make pushUpdate error verbose (#28263) - 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 --- services/repository/push.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/services/repository/push.go b/services/repository/push.go index 97da45f52b..391c8ad4ca 100644 --- a/services/repository/push.go +++ b/services/repository/push.go @@ -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