0
0
mirror of https://github.com/go-gitea/gitea.git synced 2025-03-26 22:52:44 +01:00

Adjust clone timeout error to suggest increasing timeout ()

There are far too many error reports regarding timeouts from migrations.
We should adjust error report to suggest increasing this timeout.

Ref 

Signed-off-by: Andrew Thornton <art27@cantab.net>
This commit is contained in:
zeripath 2022-11-12 18:58:26 +00:00 committed by GitHub
parent aed1622766
commit 158b088ec3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -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)
}