Skip to content

Commit

Permalink
Agma: Leftovers (#3458)
Browse files Browse the repository at this point in the history
  • Loading branch information
And1sS authored Sep 23, 2024
1 parent 8a43d31 commit 22fb331
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ public class AgmaAnalyticsReporter implements AnalyticsReporter, Initializable {

private final String url;
private final boolean compressToGzip;
private final long bufferTimeoutMs;
private final long httpTimeoutMs;

private final EventBuffer<String> buffer;
Expand All @@ -79,6 +80,7 @@ public AgmaAnalyticsReporter(AgmaAnalyticsProperties agmaAnalyticsProperties,
this.accounts = agmaAnalyticsProperties.getAccounts();

this.url = HttpUtil.validateUrl(agmaAnalyticsProperties.getUrl());
this.bufferTimeoutMs = agmaAnalyticsProperties.getBufferTimeoutMs();
this.httpTimeoutMs = agmaAnalyticsProperties.getHttpTimeoutMs();
this.compressToGzip = agmaAnalyticsProperties.isGzip();

Expand All @@ -95,7 +97,7 @@ public AgmaAnalyticsReporter(AgmaAnalyticsProperties agmaAnalyticsProperties,

@Override
public void initialize(Promise<Void> initializePromise) {
vertx.setPeriodic(1000L, ignored -> sendEvents(buffer.pollAll()));
vertx.setPeriodic(bufferTimeoutMs, ignored -> sendEvents(buffer.pollAll()));
initializePromise.complete();
}

Expand Down

0 comments on commit 22fb331

Please sign in to comment.