Skip to content

Commit 72e56af

Browse files
Don't retry queries that have exceeded context deadline (#63)
* Don't retry queries that have exceeded the context deadline.
1 parent bda53fb commit 72e56af

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

datasource.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,9 @@ func (ds *sqldatasource) handleQuery(ctx context.Context, req backend.DataQuery,
211211
return res, nil
212212
}
213213

214-
if errors.Is(err, ErrorQuery) {
214+
// If there's a query error that didn't exceed the
215+
// context deadline retry the query
216+
if errors.Is(err, ErrorQuery) && !errors.Is(err, context.DeadlineExceeded) {
215217
db, err := ds.c.Connect(dbConn.settings, q.ConnectionArgs)
216218
if err != nil {
217219
return nil, err

0 commit comments

Comments
 (0)