diff options
author | James Lopez <james@jameslopez.es> | 2017-08-31 12:24:25 +0200 |
---|---|---|
committer | James Lopez <james@jameslopez.es> | 2017-09-05 17:47:44 +0200 |
commit | 0085f5e0aef9e2d6379d2cbc03540c34dd43dc5a (patch) | |
tree | d25a02be9d42329cb647a18b0ebcd3bf5b39cf92 | |
parent | d0f5b3c287f98e3e4bdab8bf26f33262cce8f4c4 (diff) | |
download | gitlab-ce-0085f5e0aef9e2d6379d2cbc03540c34dd43dc5a.tar.gz |
start improving memory use on I/E
-rw-r--r-- | lib/gitlab/import_export/project_tree_restorer.rb | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/lib/gitlab/import_export/project_tree_restorer.rb b/lib/gitlab/import_export/project_tree_restorer.rb index cbc8d170936..6fffed68c7e 100644 --- a/lib/gitlab/import_export/project_tree_restorer.rb +++ b/lib/gitlab/import_export/project_tree_restorer.rb @@ -59,8 +59,11 @@ module Gitlab next unless relation_hash_list - relation_hash = create_relation(relation_key, relation_hash_list) - saved << restored_project.append_or_update_attribute(relation_key, relation_hash) + [relation_hash_list].flatten.each_slice(10) do |relation_hash_batch| + + relation_hash = create_relation(relation_key, relation_hash_batch) + saved << restored_project.append_or_update_attribute(relation_key, relation_hash) + end end saved.all? end @@ -77,7 +80,7 @@ module Gitlab @project.update_columns(project_params) @project end - +git che def project_params @tree_hash.reject do |key, value| # return params that are not 1 to many or 1 to 1 relations |