Stop repository if the directory disappears (fixes #154)

This commit is contained in:
Jakob Borg
2014-05-04 18:20:25 +02:00
parent 482795bab0
commit f39e105101
8 changed files with 78 additions and 10 deletions

View File

@@ -559,7 +559,7 @@ func (m *Model) ScanRepos() {
}
}
func (m *Model) ScanRepo(repo string) {
func (m *Model) ScanRepo(repo string) error {
sup := &suppressor{threshold: int64(cfg.Options.MaxChangeKbps)}
m.rmut.RLock()
w := &scanner.Walker{
@@ -572,9 +572,13 @@ func (m *Model) ScanRepo(repo string) {
}
m.rmut.RUnlock()
m.setState(repo, RepoScanning)
fs, _ := w.Walk()
fs, _, err := w.Walk()
if err != nil {
return err
}
m.ReplaceLocal(repo, fs)
m.setState(repo, RepoIdle)
return nil
}
func (m *Model) SaveIndexes(dir string) {