Sling scheduled job not executing
Hi everyone,
I’ve implemented a simple Sling scheduled job in Cloud Service. It works perfectly in my local SDK, but once deployed to the dev environment, the job never seems to run - and there are no related logs or errors.
Below the core code:
@8220494(
service = Runnable.class,
immediate = true,
configurationPolicy = ConfigurationPolicy.REQUIRE
)
@Designate(ocd = MyScheduledTask.Config)
public class MyScheduledTask implements Runnable {
@ObjectClassDefinition(name = "My Scheduled Task Configuration")
public @interface Config {
@AttributeDefinition(name = "CRON Expression")
String scheduler_expression() default "0 */1 * * * ?"; // Every 1 minute
@AttributeDefinition(name = "Concurrent execution")
boolean scheduler_concurrent() default false;
}
private static final Logger LOG = LoggerFactory.getLogger(MyScheduledTask.class);
@580286
@9182423
protected void activate(Config config) {
LOG.info("Scheduled Task configured with expression: {}", config.scheduler_expression());
}
@9944223
public void run() {
LOG.info("MyScheduledTask is running...");
}
}
And in ui.config/config.dev, I have configured:
{
"scheduler.expression": "0 */1 * * * ?",
"scheduler.concurrent": false
}
In the dev environment, the job never executes and I don’t see any logs or errors in the Cloud Manager logs, making it hard to debug.
Is there a specific configuration or restriction that prevents scheduled jobs from running?
Thanks in advance!