progress=run_sql("SELECT progress FROM schTASK WHERE id=%s",(_task_params['task_id'],))
ifprogress:
progress=progress[0][0]
else:
progress=''
g=re.match(r'Postponed \d+ time\(s\)',progress)
ifg:
postponed_times=int(g.group(1))
else:
postponed_times=0
run_sql("UPDATE schTASK SET runtime=%s, status='WAITING', progress=%s WHERE id=%s",(new_runtime,'Postponed %d time(s)'%(postponed_times+1),_task_params['task_id']))
write_message("Task #%d postponed because outside of runtime limit"%_task_params['task_id'])