diff --git a/src/main/java/com/nonononoki/alovoa/service/ScheduleService.java b/src/main/java/com/nonononoki/alovoa/service/ScheduleService.java index cd6fba90..ba234fff 100644 --- a/src/main/java/com/nonononoki/alovoa/service/ScheduleService.java +++ b/src/main/java/com/nonononoki/alovoa/service/ScheduleService.java @@ -6,6 +6,7 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; +import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; import org.springframework.data.domain.PageRequest; import org.springframework.data.domain.Sort; import org.springframework.scheduling.annotation.Scheduled; @@ -20,6 +21,7 @@ import com.nonononoki.alovoa.repo.UserRepository; @Transactional +@ConditionalOnProperty("app.scheduling.enabled") @Service public class ScheduleService { diff --git a/src/main/resources/application.properties b/src/main/resources/application.properties index d9e2f043..5cdd3944 100644 --- a/src/main/resources/application.properties +++ b/src/main/resources/application.properties @@ -239,6 +239,7 @@ app.privacy.update-date=2021-06-16 app.tos.update-date=2021-09-22 app.name=Alovoa app.domain=http://localhost:8080 +app.scheduling.enabled=true #secret in url to verify that the transaction is legit, change in production! app.donate.kofi.key=kofi123 diff --git a/src/test/resources/application-test.properties b/src/test/resources/application-test.properties index 206e3012..c761581b 100644 --- a/src/test/resources/application-test.properties +++ b/src/test/resources/application-test.properties @@ -9,6 +9,7 @@ app.text.salt=sFRKQAhwdrZq44FQ app.admin.email=admin@alovoa.com app.admin.key=password +app.scheduling.enabled=true # we don't have a working mail setup, so don't test the connection spring.mail.test-connection=false