Commit 5175c2dc authored by Jérome Perrin's avatar Jérome Perrin

fix indentation

parent 4d7a2a28
...@@ -114,22 +114,22 @@ def runWithTimeout(func, timeout, *args, **kw): ...@@ -114,22 +114,22 @@ def runWithTimeout(func, timeout, *args, **kw):
return queue.get() return queue.get()
def _runWithTimeout(queue, func, args, kw): def _runWithTimeout(queue, func, args, kw):
import signal import signal
import traceback import traceback
if hasattr(signal, 'SIGUSR1'): if hasattr(signal, 'SIGUSR1'):
signal.signal(signal.SIGUSR1, lambda sig, stack: traceback.print_stack(stack)) signal.signal(signal.SIGUSR1, lambda sig, stack: traceback.print_stack(stack))
print "To see current traceback:" print "To see current traceback:"
print " kill -SIGUSR1 %s" % os.getpid() print " kill -SIGUSR1 %s" % os.getpid()
# print a traceback when terminated. # print a traceback when terminated.
def handler(sig, stack): def handler(sig, stack):
app.logger.error("Terminating") app.logger.error("Terminating")
app.logger.info("".join(traceback.format_stack(stack))) app.logger.info("".join(traceback.format_stack(stack)))
sys.exit(0) sys.exit(0)
signal.signal(signal.SIGTERM, handler) signal.signal(signal.SIGTERM, handler)
queue.put(func(*args, **kw)) queue.put(func(*args, **kw))
@app.route("/runSimulation", methods=["POST", "OPTIONS"]) @app.route("/runSimulation", methods=["POST", "OPTIONS"])
def runSimulation(): def runSimulation():
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment