mirror of
https://github.com/Freika/dawarich.git
synced 2026-01-11 09:41:40 -05:00
Move some beds
This commit is contained in:
parent
fc8d0d8ddc
commit
41380ddf7c
4 changed files with 8 additions and 10 deletions
|
|
@ -37,8 +37,4 @@ class ExportsController < ApplicationController
|
|||
def set_export
|
||||
@export = current_user.exports.find(params[:id])
|
||||
end
|
||||
|
||||
def export_params
|
||||
params.require(:export).permit(:name, :url, :status, :format)
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -118,6 +118,7 @@ class User < ApplicationRecord
|
|||
settings.try(:[], 'maps')&.try(:[], 'url')&.strip!
|
||||
end
|
||||
|
||||
# rubocop:disable Metrics/MethodLength
|
||||
def import_sample_points
|
||||
return unless Rails.env.development? ||
|
||||
Rails.env.production? ||
|
||||
|
|
@ -134,4 +135,5 @@ class User < ApplicationRecord
|
|||
)
|
||||
)
|
||||
end
|
||||
# rubocop:enable Metrics/MethodLength
|
||||
end
|
||||
|
|
|
|||
|
|
@ -21,10 +21,10 @@ class Exports::Create
|
|||
|
||||
export.update!(status: :completed)
|
||||
|
||||
create_export_finished_notification
|
||||
notify_export_finished
|
||||
end
|
||||
rescue StandardError => e
|
||||
create_failed_export_notification(e)
|
||||
notify_export_failed(e)
|
||||
|
||||
export.update!(status: :failed)
|
||||
end
|
||||
|
|
@ -40,7 +40,7 @@ class Exports::Create
|
|||
.order(timestamp: :asc)
|
||||
end
|
||||
|
||||
def create_export_finished_notification
|
||||
def notify_export_finished
|
||||
Notifications::Create.new(
|
||||
user:,
|
||||
kind: :info,
|
||||
|
|
@ -49,7 +49,7 @@ class Exports::Create
|
|||
).call
|
||||
end
|
||||
|
||||
def create_failed_export_notification(error)
|
||||
def notify_export_failed(error)
|
||||
Notifications::Create.new(
|
||||
user:,
|
||||
kind: :error,
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ class GoogleMaps::SemanticHistoryParser
|
|||
end
|
||||
|
||||
def call
|
||||
parsed_json.each_slice(BATCH_SIZE) do |batch|
|
||||
points_data.each_slice(BATCH_SIZE) do |batch|
|
||||
@current_index += batch.size
|
||||
process_batch(batch)
|
||||
broadcast_import_progress(import, @current_index)
|
||||
|
|
@ -60,7 +60,7 @@ class GoogleMaps::SemanticHistoryParser
|
|||
)
|
||||
end
|
||||
|
||||
def parsed_json
|
||||
def points_data
|
||||
data = nil
|
||||
|
||||
import.file.download do |f|
|
||||
|
|
|
|||
Loading…
Reference in a new issue