Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
Luciano Barletta
/
message-service
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
1
Wiki
Network
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
Commit 6dbffee2
authored
2020-07-17 15:55:03 -0300
by
Tu Nombre
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
Anti mamadas por exeso de mail 4
1 parent
f2d8f6ec
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
1 deletions
process.py
process.py
View file @
6dbffee
...
...
@@ -57,7 +57,12 @@ class Process:
# manda todos los mensajes no enviados
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
):
# si no existe la carpeta borrar el mensaje
if
not
os
.
path
.
exists
(
query
[
Table
.
path
]):
...
...
@@ -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
.
stateMail
.
MailRompedor
=
[]
# devuelve el estado de un mensaje, lo archiva si está enviado
def
lookup
(
self
,
id
):
rows
=
self
.
conn
.
query
(
"SELECT * FROM msg WHERE id = ?"
,(
id
,))
if
rows
==
[]:
...
...
Write
Preview
Styling with
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment