API: Add exception logging for gearman threads

Change-Id: I0b260d22436920021b39c04b6e53196cca383a4c
This commit is contained in:
Andrew Hutchings
2013-06-18 21:12:25 +01:00
parent d76badae8a
commit 931f28195e

View File

@@ -39,13 +39,16 @@ def submit_job(job_type, host, data, lbid):
def client_job(logger, job_type, host, data, lbid): def client_job(logger, job_type, host, data, lbid):
client = GearmanClientThread(logger, host, lbid) try:
if job_type == 'UPDATE': client = GearmanClientThread(logger, host, lbid)
client.send_update(data) if job_type == 'UPDATE':
if job_type == 'DELETE': client.send_update(data)
client.send_delete(data) if job_type == 'DELETE':
if job_type == 'ARCHIVE': client.send_delete(data)
client.send_archive(data) if job_type == 'ARCHIVE':
client.send_archive(data)
except:
logger.exception("Gearman thread unhandled exception")
class GearmanClientThread(object): class GearmanClientThread(object):