()
return jsonify({'msg': '移除成功', 'status': 1})
移除任务
移除任务
移除任务
def remove_task():
    """ 移除任务 """
    data = request.json
    ids = data.get('id')
    _data = Task.query.filter_by(id=ids).first()
    _data.status = '创建'
    db.session.commit()
    try:
        scheduler.remove_job(str(ids))  # 移除任务
    except Exception as e:
        print(e)
    return jsonify({'msg': '移除成功', 'status': 1})
def remove_task ( ) : data = request . json ids = data . get ( 'id' ) _data = Task . query . filter_by ( id = ids ) . first ( ) _data . status = '创建' db . session . commit ( ) try : scheduler . remove_job ( str ( ids ) ) # 移除任务 except Exception as e : print ( e ) return jsonify ( { 'msg' : '移除成功', 'statu s : 1})