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 c077cdf0
authored
2020-07-17 16:13:17 -0300
by
Tu Nombre
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
Anti mamadas por exeso de mail 5
1 parent
6dbffee2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
3 deletions
process.py
process.py
View file @
c077cdf
...
...
@@ -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
...
...
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