diff --git a/appview/notify/merged_notifier.go b/appview/notify/merged_notifier.go --- a/appview/notify/merged_notifier.go +++ b/appview/notify/merged_notifier.go @@ -39,7 +39,6 @@ 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 --- a/appview/pulls/pulls.go +++ b/appview/pulls/pulls.go @@ -1366,12 +1366,20 @@ s.pages.Notice(w, "pull", "Failed to create pull request. Try again later.") return } + } if err = tx.Commit(); err != nil { log.Println("failed to create pull request", err) s.pages.Notice(w, "pull", "Failed to create pull request. Try again later.") 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)