Exemple #1
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)
Exemple #2
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)
Exemple #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)
Exemple #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)
Exemple #5
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)
Exemple #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)