summaryrefslogtreecommitdiffstats
path: root/modules/repository
diff options
context:
space:
mode:
authorzeripath <art27@cantab.net>2022-11-12 18:58:26 +0000
committerGitHub <noreply@github.com>2022-11-12 18:58:26 +0000
commit158b088ec3eb39e2129c2244179006b030eba947 (patch)
tree3ab101359a48f98dd7783f7421e17aba82bcaca8 /modules/repository
parentaed1622766843a093ac586c8d8a77ba85646d1ff (diff)
downloadgitea-158b088ec3eb39e2129c2244179006b030eba947.tar.gz
gitea-158b088ec3eb39e2129c2244179006b030eba947.zip
Adjust clone timeout error to suggest increasing timeout (#21769)
There are far too many error reports regarding timeouts from migrations. We should adjust error report to suggest increasing this timeout. Ref #20680 Signed-off-by: Andrew Thornton <art27@cantab.net>
Diffstat (limited to 'modules/repository')
-rw-r--r--modules/repository/repo.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/modules/repository/repo.go b/modules/repository/repo.go
index de6de3bda4..51e1699821 100644
--- a/modules/repository/repo.go
+++ b/modules/repository/repo.go
@@ -6,6 +6,7 @@ package repository
import (
"context"
+ "errors"
"fmt"
"io"
"net/http"
@@ -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)
}