diff options
author | mguetlein <martin.guetlein@gmail.com> | 2012-10-22 15:30:49 +0200 |
---|---|---|
committer | mguetlein <martin.guetlein@gmail.com> | 2012-10-22 15:30:49 +0200 |
commit | 38af51be6b4fdb4c2505382a9b9f6b0e61592641 (patch) | |
tree | e6aa26e75da8e1455033ba7bf4825edde6c526ca | |
parent | 9cc49e7b735dd5343aa9a2ef8a5aa0a71d9cef17 (diff) |
update task delete all again
-rw-r--r-- | application.rb | 3 |
1 files changed, 2 insertions, 1 deletions
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}" |