Skip to content

Commit

Permalink
Merge pull request #155 from MaryamZi/res-type-fixes
Browse files Browse the repository at this point in the history
Update active version
  • Loading branch information
MaryamZi committed Jul 26, 2020
2 parents 537f555 + a2729ce commit 3648aad
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 6 deletions.
File renamed without changes.
6 changes: 3 additions & 3 deletions distributor/web/info.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 = ":";
Expand Down
27 changes: 26 additions & 1 deletion subscriber/src/subscriber/subscriber.bal
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand All @@ -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 {
Expand All @@ -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 {
Expand All @@ -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}`);
}
};


Expand Down Expand Up @@ -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() {
Expand Down
1 change: 0 additions & 1 deletion testdriver/src/testdriver/gen_fake_parliamentary.bal
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,6 @@ function genFakeParliamentary() {
"party_name": "Foo foo",
"candidate_number": "12",
"candidate_name": "Lorem Ipsum"

},
{
"party_code": "Bar",
Expand Down

0 comments on commit 3648aad

Please sign in to comment.