4 @link: http://hierarchical-cluster-engine.com/ 5 @copyright: Copyright © 2013-2014 IOIX Ukraine 6 @license: http://hierarchical-cluster-engine.com/license/ 37 FETCH_PROXY_SQL =
"SELECT * FROM `sites_proxy` WHERE `Site_Id` = '%s' AND `Host` = '%s'" 38 query = FETCH_PROXY_SQL % (proxy.siteId, proxy.host)
39 res = queryCallback(query, Constants.PRIMARY_DB_ID)
40 if hasattr(res,
'__iter__')
and len(res) > 0
and res[0]
is not None:
50 def process(self, proxies, queryCallback):
53 if not ProxyNewTask.lookProxyInDB(proxy, queryCallback):
60 ret.statuses.append(status)
71 fields, values = Constants.getFieldsValuesTuple(proxy, Constants.ProxyTableDict)
72 fieldValueString = Constants.createFieldsValuesString(fields, values)
73 if fieldValueString
is not None and fieldValueString !=
"":
74 query = Constants.INSERT_COMMON_TEMPLATE % (
"sites_proxy", fieldValueString)
75 queryCallback(query, Constants.PRIMARY_DB_ID)
GeneralResponse event object, represents general state response for multipurpose usage.
def process(self, proxies, queryCallback)
def insertProxy(self, proxy, queryCallback)
def lookProxyInDB(proxy, queryCallback)