Add a job in the queue
        :param username:
        :param courseid:
        :param taskid:
        :param consumer_key:
        :param service_url:
        :param result_id:

def add(self, username, courseid, taskid, consumer_key, service_url, result_id):
        """ Add a job in the queue
        :param username:
        :param courseid:
        :param taskid:
        :param consumer_key:
        :param service_url:
        :param result_id:
        """
        search = {"username": username, "courseid": courseid,
                  "taskid": taskid, "service_url": service_url,
                  "consumer_key": consumer_key, "result_id": result_id}

        entry = self._database.lis_outcome_queue.find_one_and_update(search, {"$set": {"nb_attempt": 0}},
                                                                     return_document=ReturnDocument.BEFORE, upsert=True)
        if entry is None:  # and it should be
            self._add_to_queue(self._database.lis_outcome_queue.find_one(search))