Skip to content

Commit 38ce6dc

Browse files
bouktejasmanohar
authored andcommitted
Fix context support (#5)
1 parent 2066e3f commit 38ce6dc

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

conn.go

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -93,16 +93,13 @@ func (c *conn) waitOnQuery(ctx context.Context, queryID string) error {
9393
case athena.QueryExecutionStateRunning:
9494
}
9595

96-
deadline, ok := ctx.Deadline()
97-
if ok && time.Now().After(deadline) {
98-
return context.DeadlineExceeded
99-
}
100-
10196
select {
10297
case <-ctx.Done():
10398
c.athena.StopQueryExecution(&athena.StopQueryExecutionInput{
10499
QueryExecutionId: aws.String(queryID),
105100
})
101+
102+
return ctx.Err()
106103
case <-time.After(c.pollFrequency):
107104
continue
108105
}

0 commit comments

Comments
 (0)