Skip to content

Commit 42276dc

Browse files
authored
Merge pull request #35 from marqeta/add-delay-between-auto-approval
Bump the delay in PR Bot
2 parents 3191139 + 93f400a commit 42276dc

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

pullrequest/review/reviewer.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ func (r *reviewer) Approve(ctx context.Context, id id.PR, body string, opts Appr
4545
return r.handleAutoMergeError(ctx, id, err)
4646
}
4747
oplog.Info().Msgf("enabled auto merge on PR")
48-
time.Sleep(500 * time.Millisecond)
48+
time.Sleep(1 * time.Second)
4949
err = r.api.AddReview(ctx, id, body, gh.Approve)
5050
if err != nil {
5151
oplog.Err(err).Msgf("error approving PR")

pullrequest/review/reviewer_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -194,12 +194,12 @@ func Test_reviewer_Approve_Sleep(t *testing.T) {
194194
})
195195
duration := time.Since(start)
196196

197-
// Verify no error and sleep duration is at least 500ms
197+
// Verify no error and sleep duration is at least 1 second
198198
if err != nil {
199199
t.Errorf("Approve() error = %v, want nil", err)
200200
}
201-
if duration < 500*time.Millisecond {
202-
t.Errorf("Sleep duration = %v, want at least 500ms", duration)
201+
if duration < 1*time.Second {
202+
t.Errorf("Sleep duration = %v, want at least 1s", duration)
203203
}
204204
}
205205

0 commit comments

Comments
 (0)