예제 #1
0
파일: __init__.py 프로젝트: liqingqiya/task
def finish(task_id):
    """Mark the task completed."""
    values = {}
    values['updated_at'] = _now()
    values['completed_at'] = _now()
    values['is_active'] = False
    db.task_update(task_id, values)
    logging.debug('Finished task %s', task_id)
예제 #2
0
파일: __init__.py 프로젝트: liqingqiya/task
def update(task_id, progress):
    """Update the current task progress."""
    now = _now()
    values = {}
    values['updated_at'] = now
    values['progress'] = progress
    db.task_update(task_id, values)
    logging.debug('Updated task %s at %s', task_id, now)
예제 #3
0
def finish(task_id):
    """Mark the task completed."""
    values = {}
    values['updated_at'] = _now()
    values['completed_at'] = _now()
    values['is_active'] = False
    db.task_update(task_id, values)
    logging.debug('Finished task %s', task_id)
예제 #4
0
def update(task_id, progress):
    """Update the current task progress."""
    now = _now()
    values = {}
    values['updated_at'] = now
    values['progress'] = progress
    db.task_update(task_id, values)
    logging.debug('Updated task %s at %s', task_id, now)
예제 #5
0
파일: __init__.py 프로젝트: liqingqiya/task
def fail(task_id, progress=None):
    """Fail the current task with optional progress."""
    now = _now()
    values = {}
    values['updated_at'] = now
    values['is_active'] = False
    if progress:
        values['progress'] = progress
    db.task_update(task_id, values)
    logging.debug('Failed task %s at %s', task_id, now)
예제 #6
0
def fail(task_id, progress=None):
    """Fail the current task with optional progress."""
    now = _now()
    values = {}
    values['updated_at'] = now
    values['is_active'] = False
    if progress:
        values['progress'] = progress
    db.task_update(task_id, values)
    logging.debug('Failed task %s at %s', task_id, now)