Changeset View
Changeset View
Standalone View
Standalone View
src/it/reyboz/bustorino/backend/mato/MatoAPIFetcher.kt
Show First 20 Lines • Show All 66 Lines • ▼ Show 20 Lines | override fun ReadArrivalTimesAll(stopID: String?, res: AtomicReference<Fetcher.Result>?): Palina { | ||||
} | } | ||||
val requestQueue = NetworkVolleyManager.getInstance(appContext).requestQueue | val requestQueue = NetworkVolleyManager.getInstance(appContext).requestQueue | ||||
request.setTag(getVolleyReqTag(MatoQueries.QueryType.ARRIVALS)) | request.setTag(getVolleyReqTag(MatoQueries.QueryType.ARRIVALS)) | ||||
requestQueue.add(request) | requestQueue.add(request) | ||||
try { | try { | ||||
val palinaResult = future.get(5, TimeUnit.SECONDS) | val palinaResult = future.get(5, TimeUnit.SECONDS) | ||||
if (palinaResult!=null) { | if (palinaResult!=null) { | ||||
if (BuildConfig.DEBUG) | /*if (BuildConfig.DEBUG) | ||||
for (r in palinaResult.queryAllRoutes()){ | for (r in palinaResult.queryAllRoutes()){ | ||||
Log.d(DEBUG_TAG, "route " + r.gtfsId + " has " + r.passaggi.size + " passaggi: "+ r.passaggiToString) | Log.d(DEBUG_TAG, "route " + r.gtfsId + " has " + r.passaggi.size + " passaggi: "+ r.passaggiToString) | ||||
} | }*/ | ||||
palina = palinaResult | palina = palinaResult | ||||
numPassaggi = palina.minNumberOfPassages | numPassaggi = palina.minNumberOfPassages | ||||
} else{ | } else{ | ||||
Log.d(DEBUG_TAG, "Result palina is null") | Log.d(DEBUG_TAG, "Result palina is null") | ||||
} | } | ||||
} catch (e: InterruptedException) { | } catch (e: InterruptedException) { | ||||
e.printStackTrace() | e.printStackTrace() | ||||
res.set(Fetcher.Result.PARSER_ERROR) | res.set(Fetcher.Result.PARSER_ERROR) | ||||
▲ Show 20 Lines • Show All 336 Lines • ▼ Show 20 Lines | companion object{ | ||||
return patterns | return patterns | ||||
} | } | ||||
} | } | ||||
} | } | ||||
No newline at end of file | No newline at end of file |
Public contents are in Creative Commons Attribution-ShareAlike 4.0 (CC-BY-SA) or GNU Free Documentation License (at your option) unless otherwise noted. · Contact / Register