spatial_features 3.11.0 → 3.11.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 41ad7ed6a989f41b717e103a1f800a60c776ecdf772d3be54dd65128ac84882c
|
|
4
|
+
data.tar.gz: 6b741f6c962678db2edf963fdd53a87756c657476159f882af36a0bbb1685798
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: da7049b48402b343a62045dd9910c334240ebfc9d02f0738c5896d3a0033330b4293badfa5e39b9837c34204d3fb221116a79810a812ffa41b3cbf05c0784367
|
|
7
|
+
data.tar.gz: 5bf14c630adc5bf960a106e0d1ae17b4490770e62dadbcce24dfeaf0cc711ac0e77ef218266d764744a847e66e7bcd0a22cb81e153c7cf2cba1d176d2a3dc266
|
|
@@ -3,6 +3,28 @@ module SpatialFeatures
|
|
|
3
3
|
extend ActiveSupport::Concern
|
|
4
4
|
mattr_accessor :priority_offset, default: 0 # Offsets the queued priority of spatial tasks. Lower numbers run with higher priority
|
|
5
5
|
|
|
6
|
+
class_methods do
|
|
7
|
+
# Records whose most recent feature import failed. `->>` yields NULL for a missing
|
|
8
|
+
# key, so a record that has never been imported is not included.
|
|
9
|
+
def with_failed_feature_updates
|
|
10
|
+
where("spatial_processing_status_cache->>'update_features!' = 'failure'")
|
|
11
|
+
end
|
|
12
|
+
|
|
13
|
+
# Re-import everything whose last attempt failed. Nothing else retries these, so a
|
|
14
|
+
# record broken by a defect stays broken after the defect is fixed unless something
|
|
15
|
+
# sweeps it up.
|
|
16
|
+
#
|
|
17
|
+
# Queued rather than run inline, so a caller (a deploy migration, a console) doesn't
|
|
18
|
+
# block on reimporting shapefiles, and so `SpatialProcessingJob`'s callbacks maintain
|
|
19
|
+
# `spatial_processing_status_cache` — calling `#update_features!` directly bypasses
|
|
20
|
+
# them and leaves a record flagged as failed even when the retry succeeded.
|
|
21
|
+
def retry_failed_feature_updates!(**options)
|
|
22
|
+
with_failed_feature_updates.find_each do |record|
|
|
23
|
+
record.delay_update_features!(**options)
|
|
24
|
+
end
|
|
25
|
+
end
|
|
26
|
+
end
|
|
27
|
+
|
|
6
28
|
def self.update_cached_status(record, method_name, state)
|
|
7
29
|
return unless record.has_attribute?(:spatial_processing_status_cache)
|
|
8
30
|
|