| 188 | } |
| 189 | |
| 190 | func (s *FileStore) ListFiles(ctx context.Context, zoneId string) ([]*WaveFile, error) { |
| 191 | files, err := dbGetZoneFiles(ctx, zoneId) |
| 192 | if err != nil { |
| 193 | return nil, fmt.Errorf("error getting zone files: %v", err) |
| 194 | } |
| 195 | for idx, file := range files { |
| 196 | withLock(s, file.ZoneId, file.Name, func(entry *CacheEntry) error { |
| 197 | if entry.File != nil { |
| 198 | files[idx] = entry.File.DeepCopy() |
| 199 | } |
| 200 | return nil |
| 201 | }) |
| 202 | } |
| 203 | return files, nil |
| 204 | } |
| 205 | |
| 206 | func (s *FileStore) WriteMeta(ctx context.Context, zoneId string, name string, meta wshrpc.FileMeta, merge bool) error { |
| 207 | return withLock(s, zoneId, name, func(entry *CacheEntry) error { |