From 16eb3e3448ca3d5ae225fc738068cc140c05d4c5 Mon Sep 17 00:00:00 2001 From: BreakWa11 Date: Mon, 15 Feb 2016 16:19:29 +0800 Subject: [PATCH] optimize sql update --- db_transfer.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/db_transfer.py b/db_transfer.py index fb8f5d9..6e9ad17 100644 --- a/db_transfer.py +++ b/db_transfer.py @@ -57,6 +57,8 @@ class DbTransfer(object): query_sub_in = None last_time = time.time() for id in dt_transfer.keys(): + if dt_transfer[id][0] == 0 and dt_transfer[id][1] == 0: + continue query_sub_when += ' WHEN %s THEN u+%s' % (id, dt_transfer[id][0]) query_sub_when2 += ' WHEN %s THEN d+%s' % (id, dt_transfer[id][1]) if query_sub_in is not None: