Uploaded image for project: 'Mongoid'
  1. Mongoid
  2. MONGOID-4048

Could you fix : not to exit the program when Error occurs

    • Type: Icon: Task Task
    • Resolution: Done
    • 12_01_17
    • 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)

      1. @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

      2. @data_in_chunk = []
        end

            Assignee:
            Unassigned Unassigned
            Reporter:
            poc7667 poc7667
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: