Skip to content

Commit

Permalink
Fix Gradle Daemon process detection (#7524)
Browse files Browse the repository at this point in the history
  • Loading branch information
nikita-tkachenko-datadog authored Aug 29, 2024
1 parent 5c1271d commit b7907a2
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,11 @@ private static boolean isMavenParent() {
}

private static boolean isGradleDaemon() {
return ClassLoader.getSystemClassLoader().getResource("org/gradle/launcher/daemon/") != null;
return ClassLoader.getSystemClassLoader()
.getResource("org/gradle/launcher/daemon/bootstrap/GradleDaemon.class")
!= null
// double-check this is not a Gradle Worker
&& System.getProperties().getProperty("org.gradle.internal.worker.tmpdir") == null;
}

public static long getParentSessionId() {
Expand Down

0 comments on commit b7907a2

Please sign in to comment.