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)) }