From 64f8d15debddb4490088c6be050ad0fdf27028a2 Mon Sep 17 00:00:00 2001 From: Patrick Simianer Date: Mon, 23 Nov 2015 11:11:36 +0100 Subject: fix /reset_progress --- server.rb | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/server.rb b/server.rb index 385a905..53c764c 100755 --- a/server.rb +++ b/server.rb @@ -79,8 +79,12 @@ def stop_all_daemons } end -def update_database - $db['progress'] += 1 +def update_database reset=false + if !reset + $db['progress'] += 1 + else + $db['progress'] = 0 + end j = JSON.generate $db f = WriteFile.new DB_FILE f.write j.to_s @@ -386,7 +390,7 @@ get '/reset_progress' do # reset current session $db['derivations_proc'].clear $db['feedback'].clear $db['progress'] = -1 - update_database + update_database true $confirmed = true $last_reply = nil -- cgit v1.2.3