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 8fb80341
authored
2024-04-23 18:40:04 -0300
by
juan
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
Se agregan modificaciones para chequeo de chrome server
1 parent
2a6e0edc
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
19 additions
and
7 deletions
Wpp1State.py
config.py
database.py
deploy.py
enums.py
process.py
services.py
Wpp1State.py
View file @
8fb8034
...
...
@@ -16,11 +16,18 @@ class StatePhoneWs():
j
=
r
.
json
()
return
(
j
)
def
ChequearTelefono
(
self
,
telefono
):
def
Suspensor
(
self
,
data
):
"""Envia a señal al server de chrome para levantar el navegador"""
pass
def
ChequearTelefono
(
self
,
telefono
,
data
=
False
):
"""Chequea estado es el server remoto si esta conectado se almasena la
respuesta en cache durante 60 segundos para mejorar performance y si no esta
disponible no se almasena y la proxima respuesta debera hacerse contra el server
remoto para asegurarme de q se solucione el problema"""
if
data
:
self
.
Suspensor
(
data
)
test
=
self
.
revisarCache
(
telefono
)
if
not
test
==
False
:
return
(
test
)
...
...
@@ -30,7 +37,7 @@ class StatePhoneWs():
hora
=
datetime
.
datetime
.
now
()
+
datetime
.
timedelta
(
seconds
=
60
)
self
.
Consultas
[
telefono
]
=
{
"hora"
:
hora
,
"estado"
:
W
}
print
(
"Chequeando telefono saliente"
,
W
)
print
(
"Chequeando telefono saliente
33
"
,
W
)
return
(
W
)
def
revisarCache
(
self
,
telefono
):
...
...
config.py
View file @
8fb8034
WS_URL
=
"https://www.waboxapp.com/api/send/"
WS_Status
=
"https://www.waboxapp.com/api/status/"
WS_token
=
"fd378337aebead91c2eb25209aa51a7d5ce9754ea1718"
WS_uid
=
"5493412641022"
WS_uid
=
"5493412641022"
#Telefono de salida
FILE_server
=
"https://img.hgtsa.com.ar/"
SMTP_username
=
"anac.avisos@gmail.com"
SMTP_password
=
"xvc7733455"
...
...
database.py
View file @
8fb8034
...
...
@@ -14,7 +14,8 @@ class DBconnection:
Table
.
dest
:
"TEXT"
,
Table
.
type
:
"TEXT"
,
Table
.
info
:
"TEXT"
,
Table
.
state
:
"TEXT"
Table
.
state
:
"TEXT"
,
Table
.
chrome_service
:
"TEXT"
}
def
__init__
(
self
,
db
):
...
...
deploy.py
View file @
8fb8034
...
...
@@ -126,8 +126,10 @@ def msg():
Table
.
serv
:
request
.
values
[
'serv'
],
Table
.
dest
:
request
.
values
[
'dest'
],
Table
.
type
:
request
.
values
[
'type'
],
Table
.
info
:
request
.
values
.
get
(
'info'
)
Table
.
info
:
request
.
values
.
get
(
'info'
),
Table
.
chrome_service
:
request
.
values
.
get
(
'ws_chrome_server'
)
}
#if request.values.get('ws_chrome_server'):
state
=
process
.
paramstore
(
query
)
return
state
...
...
enums.py
View file @
8fb8034
...
...
@@ -6,6 +6,7 @@ class Table:
type
=
"type"
info
=
"info"
state
=
"state"
chrome_service
=
"chrome_service"
@staticmethod
def
validate
(
column
):
...
...
process.py
View file @
8fb8034
...
...
@@ -50,6 +50,7 @@ class Process:
Table
.
serv
:
query
[
Table
.
serv
],
Table
.
type
:
query
[
Table
.
type
],
Table
.
info
:
query
[
Table
.
info
],
Table
.
chrome_service
:
query
[
Table
.
chrome_service
],
Table
.
state
:
States
.
queued
}
error
=
self
.
conn
.
update
(
"msg"
,(
Table
.
id
,
query
[
Table
.
id
]),
entities
)
...
...
services.py
View file @
8fb8034
...
...
@@ -89,8 +89,8 @@ class Wpp1(ServiceBase):
succ
[
file
]
=
False
return
succ
def
controlSalida
(
self
,
stadotel
,
telefono
):
n
=
stadotel
.
ChequearTelefono
(
telefono
)
def
controlSalida
(
self
,
stadotel
,
telefono
,
data
=
False
):
n
=
stadotel
.
ChequearTelefono
(
telefono
,
data
=
data
)
if
not
n
[
"success"
]
==
True
:
raise
NameError
(
'Telefono_Desconectado'
)
...
...
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