Commit 2a6e0edc by juan

Server nuevo

1 parent fc9fc32f
...@@ -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)
......
...@@ -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=8080) app.run(host="0.0.0.0", port=9080)
...@@ -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
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!