Skip to content

Commit

Permalink
Added context to crtsh database query to prevent it from blocking for…
Browse files Browse the repository at this point in the history
…ever if the connection was lost (#1190)

Co-authored-by: Jacob Grimm <grimm@alphastrike.io>
Co-authored-by: Sandeep Singh <sandeep@projectdiscovery.io>
  • Loading branch information
3 people authored Mar 26, 2024
1 parent eef423b commit 7df3d9b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion v2/pkg/subscraping/sources/crtsh/crtsh.go
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ func (s *Source) getSubdomainsFromSQL(ctx context.Context, domain string, sessio
ca
WHERE ci.ISSUER_CA_ID = ca.ID
ORDER BY le.ENTRY_TIMESTAMP DESC NULLS LAST;`, limitClause)
rows, err := db.Query(query, domain)
rows, err := db.QueryContext(ctx, query, domain)
if err != nil {
results <- subscraping.Result{Source: s.Name(), Type: subscraping.Error, Error: err}
s.errors++
Expand Down

0 comments on commit 7df3d9b

Please sign in to comment.