Class: Gitlab::ImportExport::Base::RelationObjectSaver
- Inherits:
-
Object
- Object
- Gitlab::ImportExport::Base::RelationObjectSaver
- Includes:
- Utils::StrongMemoize
- Defined in:
- lib/gitlab/import_export/base/relation_object_saver.rb
Constant Summary collapse
- BATCH_SIZE =
100- MAX_RETRY_COUNT =
Default retry count for handling ActiveRecord::QueryCanceled
3- BATCH_SIZE_REDUCTION_FACTOR =
Factor to reduce batch size by when retrying after a timeout
4- MAX_EXCEPTION_RESCUE_COUNT =
20
Instance Attribute Summary collapse
-
#failed_subrelations ⇒ Object
readonly
Returns the value of attribute failed_subrelations.
-
#invalid_subrelations ⇒ Object
readonly
Returns the value of attribute invalid_subrelations.
Instance Method Summary collapse
- #execute ⇒ Object
-
#initialize(relation_object:, relation_key:, relation_definition:, importable:) ⇒ RelationObjectSaver
constructor
A new instance of RelationObjectSaver.
Constructor Details
#initialize(relation_object:, relation_key:, relation_definition:, importable:) ⇒ RelationObjectSaver
Returns a new instance of RelationObjectSaver.
39 40 41 42 43 44 45 46 47 |
# File 'lib/gitlab/import_export/base/relation_object_saver.rb', line 39 def initialize(relation_object:, relation_key:, relation_definition:, importable:) @relation_object = relation_object @relation_key = relation_key @relation_definition = relation_definition @importable = importable @invalid_subrelations = [] @failed_subrelations = [] @exceptions_rescued = 0 end |
Instance Attribute Details
#failed_subrelations ⇒ Object (readonly)
Returns the value of attribute failed_subrelations.
25 26 27 |
# File 'lib/gitlab/import_export/base/relation_object_saver.rb', line 25 def failed_subrelations @failed_subrelations end |
#invalid_subrelations ⇒ Object (readonly)
Returns the value of attribute invalid_subrelations.
25 26 27 |
# File 'lib/gitlab/import_export/base/relation_object_saver.rb', line 25 def invalid_subrelations @invalid_subrelations end |
Instance Method Details
#execute ⇒ Object
49 50 51 52 53 54 55 |
# File 'lib/gitlab/import_export/base/relation_object_saver.rb', line 49 def execute move_subrelations relation_object.save! save_subrelations end |