-
Type: Task
-
Resolution: Done
-
Affects Version/s: None
-
Component/s: None
-
Labels:None
Hi, I'm parse billions of data. it takes me a long time to finish the task,
Mongoid will break my whole import task, even I put rescue exception block in it and tried to ignore those errors, it still breaks my whole importing task.
Please fix this bug to save me, please please!
def bulk_insert_to_collection(collection_name)
model = collection_name.capitalize.constantize.new
begin
model.collection.insert(@data_in_chunk)
- @bulk.execute
rescue Exception=>err
log_error "[# {err}] File #{@file_path}: line of #{i} #{Time.now}"
rescue Exception => err
log_error "[#{err}] File #
{@file_path}: line of #{i} #{Time.now}"
rescue => err
p ex
log_error "{err} File #{@file_path}: line of #
{i}#
{Time.now}"
end - @data_in_chunk = []
end