@app.route('/api/work_queue/<string:queue_name>/heartbeat', methods=['POST'])
@auth.superuser_api_key_required
@utils.retryable_transaction()
def handle_heartbeat(queue_name):
    task_id = request.form.get('task_id', type=str)
    message = request.form.get('message', type=str)
    index = request.form.get('index', type=int)
    try:
        work_queue.heartbeat(
            queue_name,
            task_id,
            request.form.get('owner', request.remote_addr, type=str),
            message,
            index)
    except work_queue.Error, e:
        return utils.jsonify_error(e)

    db.session.commit()
    logging.debug('Task heartbeat: queue=%r, task_id=%r, message=%r, index=%d',
                  queue_name, task_id, message, index)
    return flask.jsonify(success=True)
Test the now method.
dataset/ETHPy150Open bslatkin/dpxdt/dpxdt/server/work_queue_handlers.py/handle_heartbeat--crossover with--dataset/ETHPy150Open home-assistant/home-assistant/tests/util/test_dt.py/TestDateUtil.test_as_utc_with_naive_object