Module: Eco::API::UseCases::GraphQL::Samples::Location::Command::DSL
- Includes:
- Helpers::Location::Command, Results, TrackChangedIds
- Defined in:
- lib/eco/api/usecases/graphql/samples/location/command/dsl.rb
Constant Summary
Constants included from TrackChangedIds
TrackChangedIds::REMAP_LOC_IDS_FILENAME, TrackChangedIds::REMAP_LOC_IDS_FOLDER
Constants included from Helpers::Location::Command::Optimizations
Helpers::Location::Command::Optimizations::DEFAULT_COMMANDS_PER_PAGE, Helpers::Location::Command::Optimizations::DEFAULT_FORCE_CONTINUE
Constants included from Helpers::Location::Base::TreeTracking
Helpers::Location::Base::TreeTracking::TAGTREE_BACKUP
Instance Attribute Summary
Attributes included from Results
Attributes included from Helpers::Base::ErrorHandling
Attributes included from Language::AuxiliarLogger
Attributes included from TrackChangedIds
Attributes included from Helpers::Location::Base::TreeTracking
Instance Method Summary collapse
- #inputs(*_args, force_continue: force_continue?, , **_kargs, &_block) ⇒ Object
-
#process ⇒ Object
Main processor.
Methods included from Results
#page_errors?, #request_results_class, #results
Methods included from Language::AuxiliarLogger
Methods included from TrackChangedIds
#close_handling_tags_remap_csv, #generate_tags_remap_csv, #tags_remap_class, #tags_remap_csv_full_filename, #tags_remap_table, #timestamp_file, #update_tags_remap_table
Methods included from Helpers::Location::Command
#apply_commands, #input, #sliced_batches, #with_sliced_input
Methods included from Helpers::Location::Command::Optimizations
#commands_payload_without_structure_block, #commands_per_page, #default_tree_tracking_mode, #force_continue?, #scope_commands_block
Methods included from Helpers::Location::Base
#live_tree, #session_live_tree, #tagtree_id, #target_structure_id, #target_structure_id_const
Methods included from Helpers::Location::Base::TreeTracking
#backup_tree, #track_current_tree, #track_current_tree?
Instance Method Details
#inputs(*_args, force_continue: force_continue?, , **_kargs, &_block) ⇒ Object
19 20 21 22 23 |
# File 'lib/eco/api/usecases/graphql/samples/location/command/dsl.rb', line 19 def inputs(*_args, force_continue: force_continue?, **_kargs, &_block) # rubocop:disable Lint/UnusedMethodArgument msg = "You should implement this method in your child class.\n" msg << "Which should yield the input Hash and the stage or descriptor." raise Eco::API::UseCases::GraphQL::Base::NotImplementedMethod, msg end |
#process ⇒ Object
Main processor
26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 |
# File 'lib/eco/api/usecases/graphql/samples/location/command/dsl.rb', line 26 def process # rubocop:disable Metrics/AbcSize self.error = false with_error_handling do super if defined?(super) # this may trigger a backup of the tagtree self.current_tree ||= live_tree inputs(force_continue: force_continue?) do |input, stage| results[stage] ||= [] track_mode = batch_tree_track_mode(stage) # yields the result of each batch sliced_batches(input, desc: stage, track_tree_mode: track_mode) do |sliced_input, response, page, pages, done, total| # rubocop:disable Metrics/ParameterLists, Layout/LineLength track_current_tree(response&.structure) results[stage] << (page_results = request_results_class.new(sliced_input, response)) (page_results, stage, current_tree) self.error = page_errors?(page_results, page, pages, done, total, stage: stage) break if error end break if error rescue StandardError => err log(:error) { err. } raise end end ensure rescued { self. = } rescued { } end |