remove every mutex change since Marshal() was crashing
This commit is contained in:
parent
84c9fe2bfc
commit
b0595d6a1d
|
@ -50,15 +50,18 @@ func (all *Repos) NewGoRepo(fullpath string, gopath string) (*Repo, error) {
|
||||||
|
|
||||||
// enforces GoPath is unique
|
// enforces GoPath is unique
|
||||||
func (all *Repos) AppendByGoPath(newr *Repo) bool {
|
func (all *Repos) AppendByGoPath(newr *Repo) bool {
|
||||||
all.RLock()
|
// all.RLock()
|
||||||
|
repoMu.RLock()
|
||||||
|
|
||||||
for _, r := range all.Repos {
|
for _, r := range all.Repos {
|
||||||
if r.GoInfo.GoPath == newr.GoInfo.GoPath {
|
if r.GoInfo.GoPath == newr.GoInfo.GoPath {
|
||||||
all.RUnlock()
|
// all.RUnlock()
|
||||||
|
repoMu.RUnlock()
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
all.RUnlock()
|
// all.RUnlock()
|
||||||
|
repoMu.RUnlock()
|
||||||
|
|
||||||
// all.Repos = append(all.Repos, newr)
|
// all.Repos = append(all.Repos, newr)
|
||||||
all.Append(newr)
|
all.Append(newr)
|
||||||
|
|
|
@ -11,7 +11,7 @@ import "google/protobuf/timestamp.proto"; // Import the well-known type for Time
|
||||||
|
|
||||||
// global settings for autogenpb `autogenpb:mutex`
|
// global settings for autogenpb `autogenpb:mutex`
|
||||||
|
|
||||||
message Repo { // `autogenpb:marshal` `autogenpb:2nomutex`
|
message Repo { // `autogenpb:marshal` `autogenpb:nomutex`
|
||||||
string fullPath = 1; // `autogenpb:unique` `autogenpb:sort` // the actual path to the .git directory: '/home/devel/golang.org/x/tools'
|
string fullPath = 1; // `autogenpb:unique` `autogenpb:sort` // the actual path to the .git directory: '/home/devel/golang.org/x/tools'
|
||||||
string masterBranchName = 3; // git 'main' or 'master' branch name
|
string masterBranchName = 3; // git 'main' or 'master' branch name
|
||||||
string develBranchName = 4; // whatever the git 'devel' branch name is
|
string develBranchName = 4; // whatever the git 'devel' branch name is
|
||||||
|
@ -38,14 +38,14 @@ message Repo { // `autogenpb:marshal` `autogenpb:2nomutex`
|
||||||
GitConfig gitConfig = 25; // protobuf of the current .git/config
|
GitConfig gitConfig = 25; // protobuf of the current .git/config
|
||||||
}
|
}
|
||||||
|
|
||||||
message Repos { // `autogenpb:marshal` `autogenpb:sort` `autogenpb:2nomutex`
|
message Repos { // `autogenpb:marshal` `autogenpb:sort` `autogenpb:nomutex`
|
||||||
string uuid = 1; // `autogenpb:uuid:8daaeba1-fb1f-4762-ae6e-95a55d352673`
|
string uuid = 1; // `autogenpb:uuid:8daaeba1-fb1f-4762-ae6e-95a55d352673`
|
||||||
string version = 2; // `autogenpb:version:2`
|
string version = 2; // `autogenpb:version:2`
|
||||||
repeated Repo repos = 3; // `autogenpb:append` // generate AppendUnique() function for this
|
repeated Repo repos = 3; // `autogenpb:append` // generate AppendUnique() function for this
|
||||||
}
|
}
|
||||||
|
|
||||||
// should it be done this way?
|
// should it be done this way?
|
||||||
message GitTimes { // `autogenpb:2nomutex`
|
message GitTimes { // `autogenpb:nomutex`
|
||||||
google.protobuf.Timestamp lastPull = 1; // last time a git pull was done
|
google.protobuf.Timestamp lastPull = 1; // last time a git pull was done
|
||||||
google.protobuf.Timestamp lastUpdate = 2; // when was ReloadGit() last done
|
google.protobuf.Timestamp lastUpdate = 2; // when was ReloadGit() last done
|
||||||
google.protobuf.Timestamp lastDirty = 3; // last time CheckDirty() was run
|
google.protobuf.Timestamp lastDirty = 3; // last time CheckDirty() was run
|
||||||
|
@ -59,7 +59,7 @@ message GitTimes { // `autogenpb:2nomutex`
|
||||||
}
|
}
|
||||||
|
|
||||||
// this is probably better. think about moving to this instead
|
// this is probably better. think about moving to this instead
|
||||||
message GoInfo { // `autogenpb:2nomutex`
|
message GoInfo { // `autogenpb:nomutex`
|
||||||
string goPath = 1; // the logical path as used by golang: 'go.wit.com/apps/helloworld'
|
string goPath = 1; // the logical path as used by golang: 'go.wit.com/apps/helloworld'
|
||||||
string desc = 2; // what is this repo?
|
string desc = 2; // what is this repo?
|
||||||
bool goLibrary = 3; // is this a golang library?
|
bool goLibrary = 3; // is this a golang library?
|
||||||
|
|
Loading…
Reference in New Issue