fix: Mark dataset as failed for PostGIS errors
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user