mirror of
https://github.com/jech/galene.git
synced 2024-11-14 04:35:57 +01:00
Improve error handling when reading groups.
This commit is contained in:
parent
df924cd468
commit
0dfa71ed71
1 changed files with 12 additions and 6 deletions
18
group.go
18
group.go
|
@ -146,19 +146,22 @@ func addGroup(name string, desc *groupDescription) (*group, error) {
|
||||||
} else if g.dead || time.Since(g.description.loadTime) > 5*time.Second {
|
} else if g.dead || time.Since(g.description.loadTime) > 5*time.Second {
|
||||||
changed, err := descriptionChanged(name, g.description)
|
changed, err := descriptionChanged(name, g.description)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
g.dead = true
|
if !os.IsNotExist(err) {
|
||||||
if !g.description.Public {
|
log.Printf("Reading group %v: %v", name, err)
|
||||||
delGroupUnlocked(name)
|
|
||||||
}
|
}
|
||||||
|
g.dead = true
|
||||||
|
delGroupUnlocked(name)
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
if changed {
|
if changed {
|
||||||
desc, err := getDescription(name)
|
desc, err := getDescription(name)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
g.dead = true
|
if !os.IsNotExist(err) {
|
||||||
if !g.description.Public {
|
log.Printf("Reading group %v: %v",
|
||||||
delGroupUnlocked(name)
|
name, err)
|
||||||
}
|
}
|
||||||
|
g.dead = true
|
||||||
|
delGroupUnlocked(name)
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
g.dead = false
|
g.dead = false
|
||||||
|
@ -518,6 +521,9 @@ func readPublicGroups() {
|
||||||
name := fi.Name()[:len(fi.Name())-5]
|
name := fi.Name()[:len(fi.Name())-5]
|
||||||
desc, err := getDescription(name)
|
desc, err := getDescription(name)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
if !os.IsNotExist(err) {
|
||||||
|
log.Printf("Reading group %v: %v", name, err)
|
||||||
|
}
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
if desc.Public {
|
if desc.Public {
|
||||||
|
|
Loading…
Reference in a new issue