@@ -91,9 +91,9 @@ async fn handle_branch_push(
91
91
let repo = push. repository . clone ( ) ;
92
92
let db = ctx. db . get ( ) . await ;
93
93
// Spawn since this can trigger a lot of work.
94
+ let gh = ctx. github . clone ( ) ;
94
95
tokio:: task:: spawn ( async move {
95
96
// See module note about locking.
96
- let gh = GithubClient :: new_from_env ( ) ;
97
97
if let Err ( e) = scan_prs ( & gh, db, & config, repo, & branch_name, & push_sha) . await {
98
98
log:: error!( "failed to scan PRs for merge conflicts: {e:?}" ) ;
99
99
}
@@ -118,10 +118,10 @@ async fn handle_pr(
118
118
let pr_number = issue. number ;
119
119
let db = ctx. db . get ( ) . await ;
120
120
let config = config. clone ( ) ;
121
+ let gh = ctx. github . clone ( ) ;
121
122
tokio:: task:: spawn ( async move {
122
123
// See module note about locking.
123
124
tokio:: time:: sleep ( UNKNOWN_RESCAN_DELAY ) . await ;
124
- let gh = GithubClient :: new_from_env ( ) ;
125
125
if let Err ( e) = rescan_pr ( & gh, db, & config, repo, pr_number) . await {
126
126
log:: error!( "failed to rescan PR for merge conflicts: {e:?}" ) ;
127
127
}
@@ -210,10 +210,10 @@ async fn scan_prs(
210
210
}
211
211
if !unknowns. is_empty ( ) {
212
212
let config = config. clone ( ) ;
213
+ let gh = gh. clone ( ) ;
213
214
tokio:: task:: spawn ( async move {
214
215
// See module note about locking.
215
216
tokio:: time:: sleep ( UNKNOWN_RESCAN_DELAY ) . await ;
216
- let gh = GithubClient :: new_from_env ( ) ;
217
217
// NOTE: The `possibly` here is even less likely to be correct due
218
218
// to the risk that another push happened while we were waiting.
219
219
// May want to consider changing it to `None` if it regularly
0 commit comments