From 38af51be6b4fdb4c2505382a9b9f6b0e61592641 Mon Sep 17 00:00:00 2001 From: mguetlein Date: Mon, 22 Oct 2012 15:30:49 +0200 Subject: update task delete all again --- application.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/application.rb b/application.rb index 9115008..369bf17 100644 --- a/application.rb +++ b/application.rb @@ -293,7 +293,8 @@ delete '/?' do i = 0 Task.all.each do |task| begin - unless task.hasStatus=="Running" + # delete running tasks only if older than one day + if task.hasStatus!="Running" or (Time.now-Time.parse(task.created_at)>86400) #Process.kill(9,task.pid.to_i) unless task.pid.nil? task.delete LOGGER.debug "deleted task #{task.id}" -- cgit v1.2.3