Commit 6dbffee2 by Tu Nombre

Anti mamadas por exeso de mail 4

1 parent f2d8f6ec
...@@ -57,7 +57,12 @@ class Process: ...@@ -57,7 +57,12 @@ class Process:
# manda todos los mensajes no enviados # manda todos los mensajes no enviados
def send(self): def send(self):
rows = self.conn.query("SELECT * FROM msg WHERE state = ? ORDER BY id DESC LIMIT 10",(States.queued,)) self._send("wpp1")
self._send("mail")
self._send("wpp1")
def _send(self,serv):
rows = self.conn.query("SELECT * FROM msg WHERE state = ? and serv = ? LIMIT 20",(States.queued,serv))
for query in DBconnection.parseToTable(rows): for query in DBconnection.parseToTable(rows):
# si no existe la carpeta borrar el mensaje # si no existe la carpeta borrar el mensaje
if not os.path.exists(query[Table.path]): if not os.path.exists(query[Table.path]):
...@@ -90,6 +95,8 @@ class Process: ...@@ -90,6 +95,8 @@ class Process:
self.conn.query("UPDATE msg SET state = ?, type = ? WHERE id = ?",(States.partial,json.dumps(d),query[Table.id])) self.conn.query("UPDATE msg SET state = ?, type = ? WHERE id = ?",(States.partial,json.dumps(d),query[Table.id]))
self.stateMail.MailRompedor = [] self.stateMail.MailRompedor = []
# devuelve el estado de un mensaje, lo archiva si está enviado # devuelve el estado de un mensaje, lo archiva si está enviado
def lookup(self,id): def lookup(self,id):
rows = self.conn.query("SELECT * FROM msg WHERE id = ?",(id,)) rows = self.conn.query("SELECT * FROM msg WHERE id = ?",(id,))
if rows == []: if rows == []:
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!