基于已封装的Task,使用session提取任务运行。(Query)

with session_scope(DB_DB) as session:
    website = session.query(Task).filter(Task.running == 0).first()

想周期运行,直接在某个时间段直接将Task的状态值改掉。(Update)

with session_scope(DB_DB) as session:
    cycle_task = session.query(Task).filter(Task.running == 1).update({'running': 0})

实现快速的周期运行😂