Skip to content
This repository has been archived by the owner on Sep 10, 2024. It is now read-only.

Commit

Permalink
Attempt to void abort.
Browse files Browse the repository at this point in the history
  • Loading branch information
bengarrett committed Feb 13, 2024
1 parent 3d4e82b commit ed7339c
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion pkg/demozoo/internal/insert/insert.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ var (

const (
sep = ","
timeout = 5 * time.Second
timeout = 10 * time.Second
)

// Record contains the values for a new Demozoo releaser production to be added to the database file table.
Expand Down
2 changes: 1 addition & 1 deletion pkg/demozoo/request.go
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ func (r Request) Queries(db *sql.DB, w io.Writer) error { //nolint:cyclop,funlen
r.Logger.Errorf("queries parseapi: %s", err)
if errors.Is(err, context.DeadlineExceeded) {
r.Logger.Warnf("%sSKIP, as demozoo.org is taking too long", str.PrePad)
break
continue
}
continue
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/demozoo/update.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ const (
dos = "dos"
win = "windows"
sep = ","
timeout = 5 * time.Second
timeout = 10 * time.Second
)

// Category are tags for production imports.
Expand Down
4 changes: 2 additions & 2 deletions pkg/download/download.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ func (r *Request) Body() error {
// CheckTime creates a valid time duration for use with http.Client.Timeout.
// The t value can be 0 or a number of seconds.
func CheckTime(t time.Duration) time.Duration {
const maxTime = 5 * time.Second
const maxTime = 10 * time.Second
secs := time.Duration(t.Seconds())
if secs < time.Second {
return maxTime
Expand Down Expand Up @@ -171,7 +171,7 @@ func Get(url string, timeout time.Duration) ([]byte, int, error) {
// PingHead connects to a URL and returns its HTTP status code and status text.
func PingHead(url string, timeout time.Duration) (*http.Response, error) {
if timeout == 0 {
const httpTimeout = 5 * time.Second
const httpTimeout = 10 * time.Second
timeout = httpTimeout
}
return ping(url, http.MethodHead, timeout)
Expand Down

0 comments on commit ed7339c

Please sign in to comment.