mirror of
https://github.com/KeymonSoft/Ruteador-NonUI.git
synced 2026-04-21 22:59:18 +00:00
- Se agregó un TRY/CATCH en generaMatrizRuteoTiempos, porque a veces en modo Release manda error.
This commit is contained in:
24
Ruteador.bas
24
Ruteador.bas
@@ -29,7 +29,7 @@ Sub Handle(req As ServletRequest, resp As ServletResponse)
|
||||
Log("############# Ruteador/Handle ########################")
|
||||
Log("##############################################################")
|
||||
' Log("q='"&req.GetParameter("q")&"'")
|
||||
Log($"REQ: ${req.FullRequestURI}"$)
|
||||
' Log($"REQ: ${req.FullRequestURI}"$)
|
||||
Private elHash As String = getHash.CalculateTheHash(req.FullRequestURI)
|
||||
' Log(elHash)
|
||||
Private ruta As String = req.GetParameter("r")
|
||||
@@ -39,7 +39,7 @@ Sub Handle(req As ServletRequest, resp As ServletResponse)
|
||||
Main.inicio = req.GetParameter("i")
|
||||
Main.final = req.GetParameter("f")
|
||||
If matriz <> "" And matriz <> "OSRM" Then matriz = ""
|
||||
Log($"r: ${ruta}, a: ${almacen}, Coords: ${coords}"$)
|
||||
' Log($"r: ${ruta}, a: ${almacen}, Coords: ${coords}"$)
|
||||
Private urlParams As Map
|
||||
If ruta <> "" And almacen <> "" And coords <> "" Then
|
||||
If Main.final <> "" Then coords = coords & ";" & Main.final
|
||||
@@ -75,17 +75,21 @@ Sub generaMatrizRuteoTiempos(r As String, resp As ServletResponse, ruta As Strin
|
||||
Log("############################################################################")
|
||||
Log("############# Ruteador/generaMatrizRuteoTiempos ####################")
|
||||
Log("############################################################################")
|
||||
'Generamos la matriz
|
||||
If matriz = "OSRM" Then
|
||||
Wait for(Main.generaMatrizOSRM(r)) Complete (Result As Int)
|
||||
Else
|
||||
Main.generaMatrizLocal(r)
|
||||
End If
|
||||
Try
|
||||
'Generamos la matriz
|
||||
If matriz = "OSRM" Then
|
||||
Wait for(Main.generaMatrizOSRM(r)) Complete (Result As Int)
|
||||
Else
|
||||
Main.generaMatrizLocal(r)
|
||||
End If
|
||||
Catch
|
||||
Log(LastException)
|
||||
End Try
|
||||
'Generamos el ruteo
|
||||
Main.ruteo($"${r}"$, matriz)
|
||||
Wait for(Main.tiempos($"${r}"$)) Complete (Result As Int)
|
||||
Private ts As Map = Main.ts.Get($"${r}"$)
|
||||
Log(ts)
|
||||
' Log(ts)
|
||||
Private tempMap As Map
|
||||
tempMap.Initialize
|
||||
If checkIfTableExists(r&"_punteo") Then
|
||||
@@ -145,7 +149,7 @@ Sub tiempos(r As String, resp As ServletResponse, ruta As String, almacen As Str
|
||||
Log("############################################################")
|
||||
Wait for(Main.tiempos($"${r}"$)) Complete (Result As Int)
|
||||
Private ts As Map = Main.ts.Get($"${r}"$)
|
||||
Log(ts)
|
||||
' Log(ts)
|
||||
Private tempMap As Map
|
||||
tempMap.Initialize
|
||||
Private p As ResultSet = Main.db.ExecQuery($"select * from ${r}_punteo"$)
|
||||
|
||||
Reference in New Issue
Block a user