Move RemoteInfo and CloneProto to info package
This commit is contained in:
8
internal/cache/cache.go
vendored
8
internal/cache/cache.go
vendored
@ -17,6 +17,7 @@ type Cache struct {
|
||||
Projects []*projects.Project
|
||||
Aliases []*ProjectAlias
|
||||
Updated time.Time
|
||||
Remotes *remotes.Remotes
|
||||
config *config.Config
|
||||
readFromFile bool
|
||||
lock *sync.Mutex // Lock the entire cache
|
||||
@ -25,7 +26,6 @@ type Cache struct {
|
||||
file string
|
||||
log *pterm.Logger
|
||||
path string
|
||||
remotes *remotes.Remotes
|
||||
}
|
||||
|
||||
type CacheOpts struct {
|
||||
@ -161,9 +161,9 @@ func (c *Cache) String() string {
|
||||
c.Updated.String(),
|
||||
len(c.Projects),
|
||||
len(c.Aliases),
|
||||
len(*c.remotes),
|
||||
len(*c.Remotes),
|
||||
)
|
||||
for _, r := range *c.remotes {
|
||||
for _, r := range *c.Remotes {
|
||||
cacheString += " " + r.GetInfo().Host
|
||||
}
|
||||
return cacheString
|
||||
@ -202,7 +202,7 @@ func NewProjectCache(opts *CacheOpts) (*Cache, error) {
|
||||
lock: &sync.Mutex{},
|
||||
contentLock: &sync.Mutex{},
|
||||
log: opts.Logger,
|
||||
remotes: opts.Remotes,
|
||||
Remotes: opts.Remotes,
|
||||
path: opts.ProjectsPath,
|
||||
}
|
||||
|
||||
|
2
internal/cache/cache_load.go
vendored
2
internal/cache/cache_load.go
vendored
@ -14,7 +14,7 @@ func (c *Cache) LoadRemotes() {
|
||||
wg := &sync.WaitGroup{}
|
||||
writer := pterm.DefaultMultiPrinter
|
||||
|
||||
for _, r := range *c.remotes {
|
||||
for _, r := range *c.Remotes {
|
||||
if !remote.IsAlive(r) {
|
||||
c.log.Error("Skipping load of remote, not alive", c.log.Args(
|
||||
"remote", r.String(),
|
||||
|
Reference in New Issue
Block a user