Skip to content
Snippets Groups Projects
Commit 70b66148 authored by marpana's avatar marpana
Browse files

cambios para presentacion

parent a35db26b
No related branches found
No related tags found
No related merge requests found
...@@ -2,7 +2,7 @@ import requests ...@@ -2,7 +2,7 @@ import requests
import time import time
import threading import threading
from datetime import datetime from datetime import datetime
token=5555 #token=5
modo=0 modo=0
buscarPartidaPath='http://localhost:3000/buscarPartida' buscarPartidaPath='http://localhost:3000/buscarPartida'
guardarPartidaPath='http://localhost:3000/bbdd' guardarPartidaPath='http://localhost:3000/bbdd'
...@@ -11,6 +11,10 @@ hilos=20 ...@@ -11,6 +11,10 @@ hilos=20
def cliente(): def cliente():
inicio = time.time() inicio = time.time()
numerohilo = hilo.getName() numerohilo = hilo.getName()
if (numerohilo == 'Thread-1'):
numerohilo = 0
token = int(numerohilo) + 1
objeto = {'token':token, "id_modo" : modo, "hilo": numerohilo} objeto = {'token':token, "id_modo" : modo, "hilo": numerohilo}
response = requests.post(buscarPartidaPath, json=objeto) response = requests.post(buscarPartidaPath, json=objeto)
...@@ -47,7 +51,7 @@ def cliente(): ...@@ -47,7 +51,7 @@ def cliente():
res2 = requests.post(guardarPartidaPath, json=postPartida2) res2 = requests.post(guardarPartidaPath, json=postPartida2)
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=num_hilo, target = cliente)
hilo.start() hilo.start()
......
import requests import requests
ficheroPath="/home/mariopanpal/Escritorio/lista_jugadores_poblar.csv" ficheroPath="/home/mariopanpal/Escritorio/jugadorespresentacion.csv"
poblarJugadoresPath='http://localhost:4000/poblarjugadores' poblarJugadoresPath='http://localhost:4000/poblarjugadores'
fileName = {"pathListaJugadores":ficheroPath} fileName = {"pathListaJugadores":ficheroPath}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment