summaryrefslogtreecommitdiff
path: root/server.rb
diff options
context:
space:
mode:
authorPatrick Simianer <p@simianer.de>2015-11-23 11:11:36 +0100
committerPatrick Simianer <p@simianer.de>2015-11-23 11:11:36 +0100
commit64f8d15debddb4490088c6be050ad0fdf27028a2 (patch)
tree801fb899f2932e4fd5e7917a9c56feb8127da49a /server.rb
parent3c4d0fd6fc684ef19642eb4fd889f84ea5f2f8ae (diff)
fix /reset_progress
Diffstat (limited to 'server.rb')
-rwxr-xr-xserver.rb10
1 files 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