startFolderDatabases loads all existing folder databases, thus causing migrations to apply.
()
| 81 | // startFolderDatabases loads all existing folder databases, thus causing |
| 82 | // migrations to apply. |
| 83 | func (s *DB) startFolderDatabases() error { |
| 84 | ids, err := s.ListFolders() |
| 85 | if err != nil { |
| 86 | return wrap(err) |
| 87 | } |
| 88 | for _, id := range ids { |
| 89 | _, err := s.getFolderDB(id, false) |
| 90 | if err != nil && !errors.Is(err, errNoSuchFolder) { |
| 91 | return wrap(err) |
| 92 | } |
| 93 | } |
| 94 | return nil |
| 95 | } |
| 96 | |
| 97 | // wrap returns the error wrapped with the calling function name and |
| 98 | // optional extra context strings as prefix. A nil error wraps to nil. |