diff options
-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}" |