Explorar o código

Make the server run time configurable

Vadim Markovtsev %!s(int64=7) %!d(string=hai) anos
pai
achega
7ef6ec890f
Modificáronse 1 ficheiros con 3 adicións e 2 borrados
  1. 3 2
      labours.py

+ 3 - 2
labours.py

@@ -883,10 +883,11 @@ def main():
         couples()
 
     if web_server.running:
-        print("Sleeping for 60 seconds, safe to Ctrl-C")
+        secs = int(os.getenv("COUPLES_SERVER_TIME", "60"))
+        print("Sleeping for %d seconds, safe to Ctrl-C" % secs)
         sys.stdout.flush()
         try:
-            time.sleep(60)
+            time.sleep(secs)
         except KeyboardInterrupt:
             pass
         web_server.stop()