support config clone timeout, do upgrades
This commit is contained in:
4
internal/cache/projects_git.go
vendored
4
internal/cache/projects_git.go
vendored
@@ -9,14 +9,12 @@ import (
|
||||
"gitea.libretechconsulting.com/rmcguire/git-project-manager/internal/remotes/projects"
|
||||
)
|
||||
|
||||
const gitCloneTimeoutSecs = 60
|
||||
|
||||
// Will either read in the current repo, preparing a report
|
||||
// on its current state, or will clone the project if it has not
|
||||
// already been cloned in its path
|
||||
func (c *Cache) OpenProject(ctx context.Context, project *projects.Project) *git.Repository {
|
||||
path := c.GetProjectPath(project)
|
||||
cloneCtx, cncl := context.WithDeadline(ctx, time.Now().Add(gitCloneTimeoutSecs*time.Second))
|
||||
cloneCtx, cncl := context.WithDeadline(ctx, time.Now().Add(c.config.GetCloneTimeout()))
|
||||
defer cncl()
|
||||
|
||||
var repo *git.Repository
|
||||
|
||||
Reference in New Issue
Block a user