Commit c077cdf0 by Tu Nombre

Anti mamadas por exeso de mail 5

1 parent 6dbffee2
......@@ -60,9 +60,11 @@ class Process:
self._send("wpp1")
self._send("mail")
self._send("wpp1")
self.stateMail.MailRompedor = []
def _send(self,serv):
rows = self.conn.query("SELECT * FROM msg WHERE state = ? and serv = ? LIMIT 20",(States.queued,serv))
salio = 0
rows = self.conn.query("SELECT * FROM msg WHERE state = ? and serv = ? ",(States.queued,serv))
for query in DBconnection.parseToTable(rows):
# si no existe la carpeta borrar el mensaje
if not os.path.exists(query[Table.path]):
......@@ -71,6 +73,7 @@ class Process:
try:
serv = serviceFactory(query[Table.serv])
success = serv.send(query,self.statePhone,self.stateMail)#envia al servicio se salida
salio = salio + 1
except:
success = {'texto': False}
print("Rompio el proseso de envio procces 71")
......@@ -93,7 +96,8 @@ class Process:
# parcialmente enviado
elif partial:
self.conn.query("UPDATE msg SET state = ?, type = ? WHERE id = ?",(States.partial,json.dumps(d),query[Table.id]))
self.stateMail.MailRompedor = []
if salio > 20:
return()
# devuelve el estado de un mensaje, lo archiva si está enviado
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!