Skip to content
Open
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
6 changes: 3 additions & 3 deletions .github/workflows/pr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ jobs:
uses: actions/checkout@v4
- name: Validate Gradle Wrapper
uses: gradle/wrapper-validation-action@v3
- name: Setup Java
- name: Set up JDK 21
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: 21
distribution: 'graalvm'
java-version: '21'
- name: Setup Gradle
uses: gradle/gradle-build-action@v2
- name: Build
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Set up JDK 21
uses: actions/setup-java@v2
uses: actions/setup-java@v4
with:
distribution: 'graalvm'
java-version: '21'
distribution: 'temurin'
- name: Setup Gradle
uses: gradle/gradle-build-action@v2
- name: Publish to Sonatype
Expand Down
1 change: 1 addition & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ java {

toolchain {
languageVersion = JavaLanguageVersion.of(21)
vendor.set(JvmVendorSpec.GRAAL_VM)
nativeImageCapable = true
}
}
Expand Down
3 changes: 3 additions & 0 deletions settings.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
rootProject.name = "posthog-java"

plugins {
id("org.gradle.toolchains.foojay-resolver-convention") version "0.8.0"
}
11 changes: 6 additions & 5 deletions src/main/java/net/hollowcube/posthog/PostHogClientImpl.java
Original file line number Diff line number Diff line change
Expand Up @@ -86,17 +86,18 @@ public final class PostHogClientImpl implements PostHogClient {
this.setPropertyIfAbsent(this.defaultEventProperties, LIB_VERSION, DEFAULT_LIBRARY_VERSION);
this.eventBatchTimeout = eventBatchTimeout;

this.allowRemoteFeatureFlagEvaluation = allowRemoteFeatureFlagEvaluation;
this.sendFeatureFlagEvents = sendFeatureFlagEvents;
this.featureFlagsRequestTimeout = featureFlagsRequestTimeout;

this.exceptionMiddleware = exceptionMiddleware;

// Always enable local evaluation with personal api key.
if (this.personalApiKey != null) {
this.featureFlagFetchTimer = new Timer(this::loadRemoteFeatureFlags, featureFlagsPollingInterval);
} else if (!allowRemoteFeatureFlagEvaluation) {
throw new IllegalArgumentException("Personal API key is required when remote feature flag evaluation is disabled");
} else this.featureFlagFetchTimer = null;
this.allowRemoteFeatureFlagEvaluation = allowRemoteFeatureFlagEvaluation;
this.sendFeatureFlagEvents = sendFeatureFlagEvents;
this.featureFlagsRequestTimeout = featureFlagsRequestTimeout;

this.exceptionMiddleware = exceptionMiddleware;
}

@Override
Expand Down
Loading