From a9c6c81de6b3dc6913ae192d9b1b1a6d41435df2 Mon Sep 17 00:00:00 2001 From: oppiliappan Date: Mon, 15 Dec 2025 12:51:24 +0000 Subject: [PATCH] appview/pulls: notify on stacked pull creation Change-Id: ktnoympkzvptnvltollrnxvvtlsnxpsm the merged_notifier no longer waits for the notifiers to complete. it is now fire-and-forget. Signed-off-by: oppiliappan --- appview/notify/merged_notifier.go | 1 - appview/pulls/pulls.go | 8 ++++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/appview/notify/merged_notifier.go b/appview/notify/merged_notifier.go index deaf57e5..fbdb1646 100644 --- a/appview/notify/merged_notifier.go +++ b/appview/notify/merged_notifier.go @@ -39,7 +39,6 @@ func (m *mergedNotifier) fanout(method string, ctx context.Context, args ...any) v.Call(in) }(n) } - wg.Wait() } func (m *mergedNotifier) NewRepo(ctx context.Context, repo *models.Repo) { diff --git a/appview/pulls/pulls.go b/appview/pulls/pulls.go index d73aa78a..bce62607 100644 --- a/appview/pulls/pulls.go +++ b/appview/pulls/pulls.go @@ -1366,6 +1366,7 @@ func (s *Pulls) createStackedPullRequest( s.pages.Notice(w, "pull", "Failed to create pull request. Try again later.") return } + } if err = tx.Commit(); err != nil { @@ -1374,6 +1375,13 @@ func (s *Pulls) createStackedPullRequest( return } + // notify about each pull + // + // this is performed after tx.Commit, because it could result in a locked DB otherwise + for _, p := range stack { + s.notifier.NewPull(r.Context(), p) + } + ownerSlashRepo := reporesolver.GetBaseRepoPath(r, repo) s.pages.HxLocation(w, fmt.Sprintf("/%s/pulls", ownerSlashRepo)) } -- 2.43.0