Skip to content

Commit

Permalink
Adjust clone timeout error to suggest increasing timeout
Browse files Browse the repository at this point in the history
There are far too many error reports regarding timeouts from migrations.
We should adjust error report to suggest increasing this timeout.

Ref go-gitea#20680

Signed-off-by: Andrew Thornton <art27@cantab.net>
  • Loading branch information
zeripath committed Nov 10, 2022
1 parent 92525dd commit 214da05
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions modules/repository/repo.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ package repository

import (
"context"
"errors"
"fmt"
"io"
"net/http"
Expand Down Expand Up @@ -79,6 +80,9 @@ func MigrateRepositoryGitData(ctx context.Context, u *user_model.User,
Timeout: migrateTimeout,
SkipTLSVerify: setting.Migrations.SkipTLSVerify,
}); err != nil {
if errors.Is(err, context.DeadlineExceeded) {
return repo, fmt.Errorf("Clone timed out. Consider increasing [git.timeout] MIGRATE in app.ini. Underlying Error: %w", err)
}
return repo, fmt.Errorf("Clone: %w", err)
}

Expand Down

0 comments on commit 214da05

Please sign in to comment.