Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>com.uid2</groupId>
<artifactId>uid2-optout</artifactId>
<version>2.0.1</version>
<version>2.0.2</version>

<name>uid2-optout</name>
<url>https://github.com/IABTechLab/uid2-optout</url>
Expand Down
20 changes: 10 additions & 10 deletions src/main/java/com/uid2/optout/vertx/OptOutServiceVerticle.java
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,10 @@ public class OptOutServiceVerticle extends AbstractVerticle {
private final boolean enableOptOutPartnerMock;
private final String internalApiKey;

public OptOutServiceVerticle(Vertx vertx, IAuthorizableProvider clientKeyProvider, ICloudStorage cloudStorage, JsonObject jsonConfig) {
public OptOutServiceVerticle(Vertx vertx,
IAuthorizableProvider clientKeyProvider,
ICloudStorage cloudStorage,
JsonObject jsonConfig) {
this.healthComponent.setHealthStatus(false, "not started");

this.cloudStorage = cloudStorage;
Expand Down Expand Up @@ -98,12 +101,10 @@ public static void sendStatus(int statusCode, HttpServerResponse response) {
}

@Override
public void start(Promise<Void> startPromise) throws Exception {
LOGGER.info("starting OptOutService");
public void start(Promise<Void> startPromise) {
this.healthComponent.setHealthStatus(false, "still starting");

try {
LOGGER.info("starting service on http.port: " + listenPort);
vertx.createHttpServer()
.requestHandler(createRouter())
.listen(listenPort, result -> handleListenResult(startPromise, result));
Expand All @@ -113,18 +114,16 @@ public void start(Promise<Void> startPromise) throws Exception {
}

startPromise.future()
.onSuccess(v -> {
LOGGER.info("started OptOutService");
})
.onSuccess(v -> LOGGER.info("OptOutServiceVerticle started on HTTP port: {}", listenPort))
.onFailure(e -> {
LOGGER.error("failed starting OptOutService", e);
LOGGER.error("OptOutServiceVerticle failed to start", e);
this.healthComponent.setHealthStatus(false, e.getMessage());
});
}

@Override
public void stop() throws Exception {
LOGGER.info("Shutting down OptOutService.");
public void stop() {
LOGGER.info("Shutting down OptOutServiceVerticle");
}

public void setCloudPaths(Collection<String> paths) {
Expand Down Expand Up @@ -287,6 +286,7 @@ private void handleReplicate(RoutingContext routingContext) {
resp.setStatusCode(200)
.setChunked(true)
.write(timestamp);
resp.end();
}
}
});
Expand Down