diff --git a/config/sidekiq.yml b/config/sidekiq.yml index 9b4e59d4..a073af8b 100644 --- a/config/sidekiq.yml +++ b/config/sidekiq.yml @@ -1,5 +1,5 @@ --- -:concurrency: <%= ENV.fetch("BACKGROUND_PROCESSING_CONCURRENCY", 100) %> +:concurrency: <%= ENV.fetch("BACKGROUND_PROCESSING_CONCURRENCY", 10) %> :queues: - default - imports diff --git a/db/data/20240610170930_remove_points_without_coordinates.rb b/db/data/20240610170930_remove_points_without_coordinates.rb new file mode 100644 index 00000000..2052f72e --- /dev/null +++ b/db/data/20240610170930_remove_points_without_coordinates.rb @@ -0,0 +1,19 @@ +# frozen_string_literal: true + +class RemovePointsWithoutCoordinates < ActiveRecord::Migration[7.1] + def up + points = Point.where('longitude = 0.0 OR latitude = 0.0') + + Rails.logger.info "Found #{points.count} points without coordinates..." + + points + .select { |point| point.raw_data['latitudeE7'].nil? && point.raw_data['longitudeE7'].nil? } + .each(&:destroy) + + Rails.logger.info 'Points without coordinates removed.' + end + + def down + raise ActiveRecord::IrreversibleMigration + end +end diff --git a/db/data_schema.rb b/db/data_schema.rb index 394d4c85..14d36074 100644 --- a/db/data_schema.rb +++ b/db/data_schema.rb @@ -1 +1 @@ -DataMigrate::Data.define(version: 20240525110530) +DataMigrate::Data.define(version: 20240610170930)