コード例 #1
0
def task_processor(dbconfig, condition):
    # Check if there are any poems that need to be written
    while (True):
        condition.acquire()
        incomplete_tasks = tasks.getIncompleteTasks(dbconfig)
        if not incomplete_tasks:
            condition.wait()
            condition.release()
        else:
            condition.release()
            writePoemForTask(dbconfig, incomplete_tasks[0])
コード例 #2
0
ファイル: wikiconnector.py プロジェクト: starakaj/wikisonnet
def task_processor(dbconfig, condition):
    # Check if there are any poems that need to be written
    while (True):
        condition.acquire()
        incomplete_tasks = tasks.getIncompleteTasks(dbconfig)
        if not incomplete_tasks:
            condition.wait()
            condition.release()
        else:
            condition.release()
            writePoemForTask(dbconfig, incomplete_tasks[0])
コード例 #3
0
ファイル: application.py プロジェクト: starakaj/wikisonnet
def getTasks():
    offset = request.args.get('offset', 0, type=int)
    limit = request.args.get('limit', 0, type=int)
    incomplete_tasks = tasks.getIncompleteTasks(dbconfig, offset, limit)
    return jsonify({"tasks":incomplete_tasks})
コード例 #4
0
def getTasks():
    offset = request.args.get('offset', 0, type=int)
    limit = request.args.get('limit', 0, type=int)
    incomplete_tasks = tasks.getIncompleteTasks(dbconfig, offset, limit)
    return jsonify({"tasks": incomplete_tasks})