def prepareautomaticrecommunication(): ''' reinjects all files for which communication failed (status = RAWOUT) ''' retransmit = False #indicate retransmit #bots keeps track of last time automaticretrycommunication was done; reason is mainly performance startidta = max( botslib.keeptrackoflastretry('bots__automaticretrycommunication', botslib.getlastrun()), botslib.get_idta_last_error()) #reinject for row4 in botslib.query( '''SELECT idta FROM ta WHERE idta>%(startidta)s AND status=%(status)s AND statust=%(statust)s ''', { 'statust': OK, 'status': RAWOUT, 'startidta': startidta }): retransmit = True ta_outgoing = botslib.OldTransaction(row4['idta']) ta_outgoing_copy = ta_outgoing.copyta(status=RAWOUT, statust=OK) ta_outgoing.update(statust=DONE) return retransmit
def prepareretry(): ''' reinjects all files for which communication failed (status = RAWOUT) ''' retransmit = False #indicate retransmit #bots keeps track of last time retry was done; reason is mainly performance startidta = max(botslib.keeptrackoflastretry('bots__retry',botslib.getlastrun()),botslib.get_idta_last_error()) #reinject for row4 in botslib.query('''SELECT idta,status FROM ta WHERE idta>%(startidta)s AND statust=%(statust)s ''', {'statust':OK,'startidta':startidta}): retransmit = True ta_outgoing = botslib.OldTransaction(row4['idta']) ta_outgoing_copy = ta_outgoing.copyta(status=row4['status'],statust=OK) ta_outgoing.update(statust=DONE) return retransmit