| Line 552... |
Line 552... |
| 552 |
|
552 |
|
| 553 |
class RetailerDetail():
|
553 |
class RetailerDetail():
|
| 554 |
global RETAILER_DETAIL_CALL_COUNTER
|
554 |
global RETAILER_DETAIL_CALL_COUNTER
|
| 555 |
def getRetryRetailer(self,failback=True):
|
555 |
def getRetryRetailer(self,failback=True):
|
| 556 |
status = RETRY_MAP.get(self.callType)
|
556 |
status = RETRY_MAP.get(self.callType)
|
| 557 |
retailer = session.query(Retailers).filter_by(status=status).filter(Retailers.next_call_time<=datetime.now()).
|
557 |
retailer = session.query(Retailers).filter_by(status=status).filter(Retailers.next_call_time<=datetime.now()).filter(or_(Retailers.agent_id==self.agentId, Retailers.agent_id==None)).order_by(Retailers.agent_id.desc(),Retailers.call_priority).order_by(Retailers.next_call_time).with_lockmode("update").first()
|
| 558 |
filter(or_(Retailers.agent_id==self.agentId, Retailers.agent_id==None)).order_by(Retailers.agent_id.desc(),Retailers.call_priority).order_by(Retailers.next_call_time).with_lockmode("update").first()
|
- |
|
| 559 |
|
558 |
|
| 560 |
if retailer is not None:
|
559 |
if retailer is not None:
|
| 561 |
lgr.info( "getRetryRetailer " + str(retailer.id))
|
560 |
lgr.info( "getRetryRetailer " + str(retailer.id))
|
| 562 |
else:
|
561 |
else:
|
| 563 |
if failback:
|
562 |
if failback:
|