~ more rides available.

pull/1/head
Ivan Olexyn 5 years ago
parent ee08b92cd9
commit 2bd1ff77e4

@ -16,8 +16,8 @@ public class ClientServlet extends HttpServlet {
protected static final String MISP_BRIDGE_URL = "http://localhost:9090/mispbridge/core"; protected static final String MISP_BRIDGE_URL = "http://localhost:9090/mispbridge/core";
protected static final String APP_URL = "http://localhost:9090"; protected static final String APP_URL = "http://localhost:9090";
public static final int AVAILABLE_RIDES_OVERHEAD = 512; public static final int AVAILABLE_RIDES_OVERHEAD_TRIGGER = 16;
public static final int AVAILABLE_RIDES_OVERHEAD = 32;
public Map<Long, Ride> rideMap = new HashMap<>(); public Map<Long, Ride> rideMap = new HashMap<>();
@ -135,10 +135,11 @@ class PostRideRunnable implements Runnable {
if (availableRides< ClientServlet.AVAILABLE_RIDES_OVERHEAD) { if (availableRides< ClientServlet.AVAILABLE_RIDES_OVERHEAD_TRIGGER) {
for (int i=0; i<ClientServlet.AVAILABLE_RIDES_OVERHEAD;i++) {
try {clientServlet.sendPostRide(new Ride());} catch (IOException | ServletException | InterruptedException e) { e.printStackTrace(); } try {clientServlet.sendPostRide(new Ride());} catch (IOException | ServletException | InterruptedException e) { e.printStackTrace(); }
} }
try {Thread.sleep(100);} catch (InterruptedException e) { e.printStackTrace(); } }
} }
} }
} }

Loading…
Cancel
Save