~emersion/hottub

2a8fbf0f5eb67fce4021270dec5362f9fa7d348c — Simon Ser 5 months ago 01e2853 master
Use a different timeout for setting failed startCheckSuite status
1 files changed, 8 insertions(+), 1 deletions(-)

M main.go
M main.go => main.go +8 -1
@@ 402,9 402,16 @@ func startCheckSuite(ctx *checkSuiteContext) (err error) {
			err = nil
		}

		// Shallow copy check suite context to assign a different deadline
		failCtx := *ctx

		failBareCtx, cancel := context.WithTimeout(context.Background(), 30*time.Second)
		defer cancel()
		failCtx.Context = failBareCtx

		statusContext := "builds.sr.ht"
		repoStatus := &github.RepoStatus{Context: &statusContext}
		statusErr := updateRepoStatus(ctx, repoStatus, "failure", msg)
		statusErr := updateRepoStatus(&failCtx, repoStatus, "failure", msg)
		if statusErr != nil {
			log.Printf("failed to create commit status: %v", statusErr)
		}