Skip to content
Snippets Groups Projects
Commit 45b9f200 authored by marpana's avatar marpana
Browse files

cambios menores de formato

parent 006432fa
No related branches found
No related tags found
No related merge requests found
...@@ -196,7 +196,7 @@ async function calculo (){ ...@@ -196,7 +196,7 @@ async function calculo (){
//Se suma 1 a los periodos sin jugar de los jugadores que no han disputado ninguan partida durante el periodo //Se suma 1 a los periodos sin jugar de los jugadores que no han disputado ninguan partida durante el periodo
sumarUnoPeriodosSinJugar(nuevos_datos_totales, indiceModo, jugadores_actualizar) sumarUnoPeriodosSinJugar(nuevos_datos_totales, indiceModo, jugadores_actualizar)
var finalAct = process.hrtime(inicioAct) var finalAct = process.hrtime(inicioAct)
console.log("tiempo de actualizacion +1:", finalAct) console.log("tiempo de actualizacion:", finalAct)
} }
await HistorialPartidas.deleteMany() await HistorialPartidas.deleteMany()
await ListaJugadores.deleteMany() await ListaJugadores.deleteMany()
...@@ -214,7 +214,7 @@ app.use("/registrarjugador", require("./routes/registrarJugador")) ...@@ -214,7 +214,7 @@ app.use("/registrarjugador", require("./routes/registrarJugador"))
/** /**
* Job que se activa al final de un periodo y calcula las nuevas puntuaciones para los jugadores que han disputado al menos una partida. * Job que se activa al final de un periodo y calcula las nuevas puntuaciones para los jugadores que han disputado al menos una partida.
*/ */
cron.schedule('06 * * * *', async function() { cron.schedule('*/30 * * * *', async function() {
HistorialPartidas.deleteMany() HistorialPartidas.deleteMany()
var partidasTotales var partidasTotales
getHistorial().then(resp =>{ getHistorial().then(resp =>{
...@@ -224,7 +224,6 @@ cron.schedule('06 * * * *', async function() { ...@@ -224,7 +224,6 @@ cron.schedule('06 * * * *', async function() {
calculo() calculo()
}); });
}) })
}) })
/** /**
... ...
......
...@@ -15,7 +15,6 @@ describe('/poblarJugadores', () => { ...@@ -15,7 +15,6 @@ describe('/poblarJugadores', () => {
test('poblarJugadores 200', async () => { test('poblarJugadores 200', async () => {
const res = await request(application).post("/poblarJugadores").send(fileName) const res = await request(application).post("/poblarJugadores").send(fileName)
var listaJugadores1000 = await ListaJugadores.find({id_modo:1}) var listaJugadores1000 = await ListaJugadores.find({id_modo:1})
console.log(listaJugadores1000)
expect(res.statusCode).toBe(200) expect(res.statusCode).toBe(200)
}) })
... ...
......
...@@ -18,8 +18,6 @@ mongoose.connect(uri ...@@ -18,8 +18,6 @@ mongoose.connect(uri
.then(() => console.log("Conectamos con la base de datos")) .then(() => console.log("Conectamos con la base de datos"))
.catch(e => console.log(e)) .catch(e => console.log(e))
const app = express() const app = express()
app.use(bodyParser.urlencoded({ extended: false })); app.use(bodyParser.urlencoded({ extended: false }));
app.use(bodyParser.json()); app.use(bodyParser.json());
... ...
......
...@@ -43,9 +43,6 @@ def cliente(): ...@@ -43,9 +43,6 @@ def cliente():
res1 = requests.post(guardarPartidaPath, json=postPartida1) res1 = requests.post(guardarPartidaPath, json=postPartida1)
res2 = requests.post(guardarPartidaPath, json=postPartida2) res2 = requests.post(guardarPartidaPath, json=postPartida2)
""" print(res1.text)
print(res2.text) """
for num_hilo in range(hilos): for num_hilo in range(hilos):
hilo = threading.Thread(name='hilo%s' %num_hilo, target = cliente) hilo = threading.Thread(name='hilo%s' %num_hilo, target = cliente)
hilo.start() hilo.start()
... ...
......
...@@ -5,6 +5,5 @@ registrarJugadorPath='http://localhost:4000/registrarjugador' ...@@ -5,6 +5,5 @@ registrarJugadorPath='http://localhost:4000/registrarjugador'
jugadorRegistrar = {"id_jugador": idJugador, "id_modo": idModo} jugadorRegistrar = {"id_jugador": idJugador, "id_modo": idModo}
#response = requests.post('http://virtual.infor.uva.es:65132/registrarjugador', data = jugadorRegistrar)
response = requests.post(registrarJugadorPath, data = jugadorRegistrar) response = requests.post(registrarJugadorPath, data = jugadorRegistrar)
print(response.text) print(response.text)
\ No newline at end of file
...@@ -4,7 +4,5 @@ poblarJugadoresPath='http://localhost:4000/poblarjugadores' ...@@ -4,7 +4,5 @@ poblarJugadoresPath='http://localhost:4000/poblarjugadores'
fileName = {"pathListaJugadores":ficheroPath} fileName = {"pathListaJugadores":ficheroPath}
#response = requests.post('http://virtual.infor.uva.es:65132/poblarjugadores', data = fileName)
response = requests.post(poblarJugadoresPath, data = fileName) response = requests.post(poblarJugadoresPath, data = fileName)
print(response.text) print(response.text)
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment