From 2bd1ff77e47ab2bc37e5522466eeef9cd0e4190c Mon Sep 17 00:00:00 2001 From: Ivan Olexyn Date: Mon, 20 Apr 2020 02:12:42 +0200 Subject: [PATCH] ~ more rides available. --- mispclient/src/core/ClientServlet.java | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/mispclient/src/core/ClientServlet.java b/mispclient/src/core/ClientServlet.java index 902367c..9c8e012 100644 --- a/mispclient/src/core/ClientServlet.java +++ b/mispclient/src/core/ClientServlet.java @@ -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 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 rideMap = new HashMap<>(); @@ -135,10 +135,11 @@ class PostRideRunnable implements Runnable { - if (availableRides< ClientServlet.AVAILABLE_RIDES_OVERHEAD) { - try {clientServlet.sendPostRide(new Ride());} catch (IOException | ServletException | InterruptedException e) { e.printStackTrace(); } + if (availableRides< ClientServlet.AVAILABLE_RIDES_OVERHEAD_TRIGGER) { + for (int i=0; i