Skip to content

Commit 158b088

Browse files
authored
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 <[email protected]>
1 parent aed1622 commit 158b088

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

modules/repository/repo.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ package repository
66

77
import (
88
"context"
9+
"errors"
910
"fmt"
1011
"io"
1112
"net/http"
@@ -79,6 +80,9 @@ func MigrateRepositoryGitData(ctx context.Context, u *user_model.User,
7980
Timeout: migrateTimeout,
8081
SkipTLSVerify: setting.Migrations.SkipTLSVerify,
8182
}); err != nil {
83+
if errors.Is(err, context.DeadlineExceeded) {
84+
return repo, fmt.Errorf("Clone timed out. Consider increasing [git.timeout] MIGRATE in app.ini. Underlying Error: %w", err)
85+
}
8286
return repo, fmt.Errorf("Clone: %w", err)
8387
}
8488

0 commit comments

Comments
 (0)