fix: Mark dataset as failed for PostGIS errors

This commit is contained in:
2026-07-01 16:58:51 +05:00
parent f74253140f
commit 6113202704
3 changed files with 110 additions and 5 deletions

View File

@@ -457,6 +457,17 @@ func (s *DatasetService) Parse(ctx context.Context, id uuid.UUID) error {
return s.repo.MarkParsed(ctx, id, cols)
}
// MarkFailed records a terminal processing failure on a dataset, moving it out
// of any in-progress status. The worker calls this when a job returns an error
// (e.g. a PostGIS insert failure) so the dataset is not left stuck. Marking a
// dataset that no longer exists is not treated as an error.
func (s *DatasetService) MarkFailed(ctx context.Context, id uuid.UUID, reason string) error {
if err := s.repo.MarkParseFailed(ctx, id, reason); err != nil && !errors.Is(err, domain.ErrNotFound) {
return err
}
return nil
}
func (s *DatasetService) fetchObject(ctx context.Context, key string) ([]byte, error) {
obj, err := s.store.Get(ctx, key)
if err != nil {