netrender: Ctrl-C correctly stops master in background mode (low level select was catching the break and spiting and exception)

This commit is contained in:
Martin Poirier
2010-01-06 20:17:27 +00:00
parent 0cc7b5800c
commit 59ec8ee1ab

View File

@@ -19,6 +19,7 @@
import sys, os
import http, http.client, http.server, urllib, socket
import subprocess, shutil, time, hashlib
import select # for select.error
from netrender.utils import *
import netrender.model
@@ -928,7 +929,10 @@ def runMaster(address, broadcast, clear, path, update_stats, test_break):
start_time = time.time()
while not test_break():
httpd.handle_request()
try:
httpd.handle_request()
except select.error:
pass
if time.time() - start_time >= 10: # need constant here
httpd.timeoutSlaves()