diff --git a/distributor/web/active-2020-07-25 b/distributor/web/active-2020-07-26 similarity index 100% rename from distributor/web/active-2020-07-25 rename to distributor/web/active-2020-07-26 diff --git a/distributor/web/info.txt b/distributor/web/info.txt index 17b37c4..be5e764 100644 --- a/distributor/web/info.txt +++ b/distributor/web/info.txt @@ -2,15 +2,15 @@ ****** IMPORTANT ******* ** -** The latest version of the subscriber JAR is subscriber-20200725.jar +** The latest version of the subscriber JAR is subscriber-20200726.jar ** -** Available at https://github.com/ECLK/Results-Dist/releases/tag/v2020-07-25 +** Available at https://github.com/ECLK/Results-Dist/releases/tag/v2020-07-26 ** ****** IMPORTANT ******* Run it as follows: -java -jar subscriber-20200725.jar [options] +java -jar subscriber-20200726.jar [options] where options are: -username=name my username for authentication diff --git a/subscriber/src/subscriber/Constants.bal b/subscriber/src/subscriber/constants.bal similarity index 95% rename from subscriber/src/subscriber/Constants.bal rename to subscriber/src/subscriber/constants.bal index 609f910..1653061 100644 --- a/subscriber/src/subscriber/Constants.bal +++ b/subscriber/src/subscriber/constants.bal @@ -9,7 +9,7 @@ const LEVEL_NF = "NATIONAL-FINAL"; const WANT_IMAGE = "image=true"; const WANT_AWAIT_RESULTS = "await=true"; -const MY_VERSION = "2020-07-25"; +const MY_VERSION = "2020-07-26"; const UNDERSOCRE = "_"; const COLON = ":"; diff --git a/subscriber/src/subscriber/subscriber.bal b/subscriber/src/subscriber/subscriber.bal index 8b117e7..82a89f7 100644 --- a/subscriber/src/subscriber/subscriber.bal +++ b/subscriber/src/subscriber/subscriber.bal @@ -129,7 +129,16 @@ public function main (string? username = (), // my username headers[http:AUTH_HEADER] = string `Basic ${token}`; } - http:WebSocketClient wsClientEp = new (wsUrl, config = {callbackService: callbackService, customHeaders: headers}); + http:WebSocketClient wsClientEp = new (wsUrl, config = { + callbackService: callbackService, + customHeaders: headers, + retryConfig: { + intervalInMillis: 3000, + maxCount: 10, + backOffFactor: 1.5, + maxWaitIntervalInMillis: 20000 + } + }); if wsClientEp.isOpen() { io:println( @@ -151,6 +160,10 @@ service resultDataOnlyClientService = @http:WebSocketServiceConfig {} service { resource function onError(http:WebSocketClient conn, error err) { log:printError("Error occurred", err); } + + resource function onClose(http:WebSocketClient wsEp, int statusCode, string reason) { + log:printInfo(string `Connection closed: statusCode: ${statusCode}, reason: ${reason}`); + } }; service awaitAndResultDataClientService = @http:WebSocketServiceConfig {} service { @@ -174,6 +187,10 @@ service awaitAndResultDataClientService = @http:WebSocketServiceConfig {} servic resource function onError(http:WebSocketClient conn, error err) { log:printError("Error occurred", err); } + + resource function onClose(http:WebSocketClient wsEp, int statusCode, string reason) { + log:printInfo(string `Connection closed: statusCode: ${statusCode}, reason: ${reason}`); + } }; service imageAndResultDataClientService = @http:WebSocketServiceConfig {} service { @@ -199,6 +216,10 @@ service imageAndResultDataClientService = @http:WebSocketServiceConfig {} servic resource function onError(http:WebSocketClient conn, error err) { log:printError("Error occurred", err); } + + resource function onClose(http:WebSocketClient wsEp, int statusCode, string reason) { + log:printInfo(string `Connection closed: statusCode: ${statusCode}, reason: ${reason}`); + } }; @@ -232,6 +253,10 @@ service allClientService = @http:WebSocketServiceConfig {} service { resource function onError(http:WebSocketClient conn, error err) { log:printError("Error occurred", err); } + + resource function onClose(http:WebSocketClient wsEp, int statusCode, string reason) { + log:printInfo(string `Connection closed: statusCode: ${statusCode}, reason: ${reason}`); + } }; function notifyAwait() { diff --git a/testdriver/src/testdriver/gen_fake_parliamentary.bal b/testdriver/src/testdriver/gen_fake_parliamentary.bal index 96d0a9e..5e9ef50 100644 --- a/testdriver/src/testdriver/gen_fake_parliamentary.bal +++ b/testdriver/src/testdriver/gen_fake_parliamentary.bal @@ -363,7 +363,6 @@ function genFakeParliamentary() { "party_name": "Foo foo", "candidate_number": "12", "candidate_name": "Lorem Ipsum" - }, { "party_code": "Bar",