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 2a6e0edc
authored
2024-04-09 16:23:29 -0300
by
juan
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
Server nuevo
1 parent
fc9fc32f
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
8 deletions
Wpp1State.py
deploy.py
services.py
Wpp1State.py
View file @
2a6e0ed
...
@@ -121,10 +121,11 @@ class StateMail():
...
@@ -121,10 +121,11 @@ class StateMail():
"""Devuelve la cantidad de mails que se puede enviar diariamente
"""Devuelve la cantidad de mails que se puede enviar diariamente
La lista de donde se toma esta informacion esta en un json
La lista de donde se toma esta informacion esta en un json
Mira la configuracion"""
Mira la configuracion"""
with
open
(
config
.
ArchivoLimitesHosts
)
as
json_file
:
data
=
json
.
load
(
json_file
)
try
:
try
:
n
=
data
[
host
]
n
=
200
with
open
(
config
.
ArchivoLimitesHosts
)
as
json_file
:
data
=
json
.
load
(
json_file
)
n
=
data
[
host
]
except
:
except
:
n
=
config
.
LimiteDiario
n
=
config
.
LimiteDiario
return
(
n
)
return
(
n
)
...
...
deploy.py
View file @
2a6e0ed
...
@@ -179,4 +179,4 @@ if __name__ == "__main__":
...
@@ -179,4 +179,4 @@ if __name__ == "__main__":
# creo msg/ si no existe
# creo msg/ si no existe
if
not
os
.
path
.
exists
(
msgfolder
):
if
not
os
.
path
.
exists
(
msgfolder
):
os
.
mkdir
(
msgfolder
)
os
.
mkdir
(
msgfolder
)
app
.
run
(
host
=
"0.0.0.0"
,
port
=
8
080
)
app
.
run
(
host
=
"0.0.0.0"
,
port
=
9
080
)
services.py
View file @
2a6e0ed
...
@@ -84,8 +84,8 @@ class Wpp1(ServiceBase):
...
@@ -84,8 +84,8 @@ class Wpp1(ServiceBase):
path
=
requests
.
post
(
url
=
Wpp1
.
server
,
files
=
{
'data'
:
(
file
,
open
(
filepath
,
'rb'
))
})
path
=
requests
.
post
(
url
=
Wpp1
.
server
,
files
=
{
'data'
:
(
file
,
open
(
filepath
,
'rb'
))
})
result
=
requests
.
get
(
url
=
Wpp1
.
URL
+
Wpp1
.
URLmode
[
types
[
file
]],
params
=
{
'token'
:
Wpp1
.
token
,
'uid'
:
origen
,
'to'
:
data
[
Table
.
dest
],
'url'
:
Wpp1
.
server
+
path
.
text
})
result
=
requests
.
get
(
url
=
Wpp1
.
URL
+
Wpp1
.
URLmode
[
types
[
file
]],
params
=
{
'token'
:
Wpp1
.
token
,
'uid'
:
origen
,
'to'
:
data
[
Table
.
dest
],
'url'
:
Wpp1
.
server
+
path
.
text
})
succ
[
file
]
=
result
.
json
()[
'success'
]
succ
[
file
]
=
result
.
json
()[
'success'
]
except
:
except
Exception
as
E
:
print
(
"ROMPIO ALGO EN EL ENVIO
"
)
print
(
f
"ROMPIO ALGO EN EL ENVIO: {E}
"
)
succ
[
file
]
=
False
succ
[
file
]
=
False
return
succ
return
succ
...
@@ -159,8 +159,8 @@ class Mail(ServiceBase):
...
@@ -159,8 +159,8 @@ class Mail(ServiceBase):
self
.
Envio
(
msg
,
info
,
stadomail
)
self
.
Envio
(
msg
,
info
,
stadomail
)
else
:
else
:
succ
[
file
]
=
False
succ
[
file
]
=
False
except
:
except
Exception
as
E
:
print
(
"ROMPIO ALGO EN EL ENVIO
"
)
print
(
f
"ROMPIO ALGO EN EL ENVIO: {E}
"
)
stadomail
.
MailRompedor
.
append
(
msg
[
'From'
])
stadomail
.
MailRompedor
.
append
(
msg
[
'From'
])
succ
[
file
]
=
False
succ
[
file
]
=
False
return
succ
return
succ
...
...
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