code: 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)
docs: Updates the heartbeat message for a task.