Skip to content

Commit 15d9388

Browse files
committed
Merge branch 'feat/crons-lib-support' into feat/crons-options
2 parents b2290f5 + 41cf842 commit 15d9388

File tree

5 files changed

+1
-25
lines changed

5 files changed

+1
-25
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
- Add `sendModules` option for disable sending modules ([#2926](https://github.com/getsentry/sentry-java/pull/2926))
88
- Send `db.system` and `db.name` in span data for androidx.sqlite spans ([#2928](https://github.com/getsentry/sentry-java/pull/2928))
99
- Add API for sending checkins (CRONS) manually ([#2935](https://github.com/getsentry/sentry-java/pull/2935))
10-
- Automatic CRON checkins for Quartz ([#2940](https://github.com/getsentry/sentry-java/pull/2940))
10+
- Support check-ins (CRONS) for Quartz ([#2940](https://github.com/getsentry/sentry-java/pull/2940))
1111
- Add option for ignoring certain monitor slugs ([#2943](https://github.com/getsentry/sentry-java/pull/2943))
1212

1313
### Fixes

sentry-quartz/api/sentry-quartz.api

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ public final class io/sentry/quartz/SentryJobListener : org/quartz/JobListener {
77
public static final field SENTRY_CHECK_IN_ID_KEY Ljava/lang/String;
88
public static final field SENTRY_CHECK_IN_SLUG_KEY Ljava/lang/String;
99
public fun <init> ()V
10-
public fun <init> (Lio/sentry/IHub;)V
1110
public fun getName ()Ljava/lang/String;
1211
public fun jobExecutionVetoed (Lorg/quartz/JobExecutionContext;)V
1312
public fun jobToBeExecuted (Lorg/quartz/JobExecutionContext;)V

sentry-quartz/src/main/java/io/sentry/quartz/SentryJobListener.java

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,13 @@
33
import io.sentry.BuildConfig;
44
import io.sentry.CheckIn;
55
import io.sentry.CheckInStatus;
6-
import io.sentry.HubAdapter;
7-
import io.sentry.IHub;
86
import io.sentry.MonitorConfig;
97
import io.sentry.MonitorSchedule;
108
import io.sentry.MonitorScheduleUnit;
119
import io.sentry.Sentry;
1210
import io.sentry.SentryIntegrationPackageStorage;
1311
import io.sentry.SentryLevel;
1412
import io.sentry.protocol.SentryId;
15-
import io.sentry.util.Objects;
1613
import java.util.List;
1714
import java.util.TimeZone;
1815
import org.jetbrains.annotations.NotNull;
@@ -34,14 +31,7 @@ public final class SentryJobListener implements JobListener {
3431
public static final String SENTRY_CHECK_IN_ID_KEY = "sentry-checkin-id";
3532
public static final String SENTRY_CHECK_IN_SLUG_KEY = "sentry-checkin-slug";
3633

37-
private final @NotNull IHub hub;
38-
3934
public SentryJobListener() {
40-
this(HubAdapter.getInstance());
41-
}
42-
43-
public SentryJobListener(final @NotNull IHub hub) {
44-
this.hub = Objects.requireNonNull(hub, "hub is required");
4535
SentryIntegrationPackageStorage.getInstance().addIntegration("Quartz");
4636
SentryIntegrationPackageStorage.getInstance()
4737
.addPackage("maven:io.sentry:sentry-quartz", BuildConfig.VERSION_NAME);
@@ -55,9 +45,6 @@ public String getName() {
5545
@Override
5646
public void jobToBeExecuted(JobExecutionContext context) {
5747
try {
58-
if (isDisabled()) {
59-
return;
60-
}
6148
final @NotNull String slug = getSlug(context.getJobDetail());
6249
final @NotNull CheckIn checkIn = new CheckIn(slug, CheckInStatus.IN_PROGRESS);
6350

@@ -196,10 +183,6 @@ public void jobExecutionVetoed(JobExecutionContext context) {
196183
@Override
197184
public void jobWasExecuted(JobExecutionContext context, JobExecutionException jobException) {
198185
try {
199-
if (isDisabled()) {
200-
return;
201-
}
202-
203186
final @Nullable Object checkInIdObjectFromContext = context.get(SENTRY_CHECK_IN_ID_KEY);
204187
final @Nullable Object slugObjectFromContext = context.get(SENTRY_CHECK_IN_SLUG_KEY);
205188
final @NotNull SentryId checkInId =
@@ -220,8 +203,4 @@ public void jobWasExecuted(JobExecutionContext context, JobExecutionException jo
220203
.log(SentryLevel.ERROR, "Unable to capture check-in in jobWasExecuted.", t);
221204
}
222205
}
223-
224-
private boolean isDisabled() {
225-
return !hub.getOptions().isEnableAutomaticCheckIns();
226-
}
227206
}

sentry-spring-boot-jakarta/src/main/java/io/sentry/spring/boot/jakarta/SentryAutoConfiguration.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,6 @@ static class GraphqlConfiguration {}
174174
@Configuration(proxyBeanMethods = false)
175175
@Import(SentryQuartzConfiguration.class)
176176
@Open
177-
@ConditionalOnProperty(name = "sentry.enable-automatic-checkins")
178177
@ConditionalOnClass({
179178
SentryJobListener.class,
180179
QuartzScheduler.class,

sentry-spring-boot/src/main/java/io/sentry/spring/boot/SentryAutoConfiguration.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,6 @@ static class GraphqlConfiguration {}
174174
@Configuration(proxyBeanMethods = false)
175175
@Import(SentryQuartzConfiguration.class)
176176
@Open
177-
@ConditionalOnProperty(name = "sentry.enable-automatic-checkins")
178177
@ConditionalOnClass({
179178
SentryJobListener.class,
180179
QuartzScheduler.class,

0 commit comments

Comments
 (0)