Commit 2a6e0edc by juan

Server nuevo

1 parent fc9fc32f
......@@ -121,10 +121,11 @@ class StateMail():
"""Devuelve la cantidad de mails que se puede enviar diariamente
La lista de donde se toma esta informacion esta en un json
Mira la configuracion"""
with open(config.ArchivoLimitesHosts) as json_file:
data = json.load(json_file)
try:
n = data[host]
n = 200
with open(config.ArchivoLimitesHosts) as json_file:
data = json.load(json_file)
n = data[host]
except:
n = config.LimiteDiario
return(n)
......
......@@ -179,4 +179,4 @@ if __name__ == "__main__":
# creo msg/ si no existe
if not os.path.exists(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):
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})
succ[file] = result.json()['success']
except:
print("ROMPIO ALGO EN EL ENVIO")
except Exception as E:
print(f"ROMPIO ALGO EN EL ENVIO: {E}")
succ[file] = False
return succ
......@@ -159,8 +159,8 @@ class Mail(ServiceBase):
self.Envio(msg,info,stadomail)
else:
succ[file] = False
except:
print("ROMPIO ALGO EN EL ENVIO")
except Exception as E:
print(f"ROMPIO ALGO EN EL ENVIO: {E}")
stadomail.MailRompedor.append(msg['From'])
succ[file] = False
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!