Expand my Community achievements bar.

SOLVED

How can I force remove an item in the slingscheduler?

Avatar

Level 7

I have a job in the /system/console/status-slingscheduler. 

Job : PIM Menu cache scheduler, class: com.mybrand.SchedulerService, concurrent: false, bundleId: 200
Trigger : Trigger 'DEFAULT.schedular service scheduler':  triggerClass: 'org.quartz.impl.triggers.CronTriggerImpl calendar: 'null' misfireInstruction: 0 nextFireTime: Thu October 30 16:22:00 UTC 2022

 How do force remove this from the slingscheduler? It's stuck. I tried to change the cron configurations in OSGI / Config Manager, but it did not change the status of what is being shown in /system/console/status-slingscheduler. 

1 Accepted Solution

Avatar

Correct answer by
Employee Advisor

Are you planning to do it permanently? 

 

As @arunpatidar has mentioned if we stop the Scheduler via http://localhost:4502/system/console/components 

then the relevant job will be removed from /system/console/status-slingscheduler (tested on my local AEM instance).

But once you redeploy your bundle or restart your bundle then again, this Job will be available.

 

View solution in original post

4 Replies

Avatar

Community Advisor

Hi @AEMWizard ,

Not sure if  there is a way to remove scheduler. However, two solutions you can consider

  • You can keep scheduler running and have checkbox OSGI property at the scheduler level. And based on this property, you can decide whether you need execute rest of the code or not.
  • Another option is to write a simple supporting service which will have a checkbox OSGI property and based on chosen option you can schedule or unschedule a scheduler service. Assuming scheduler service is being registered from this supporting service not through OSGI property & cron job.

Hope that helps!

Regards,

Santosh

Avatar

Community Advisor

Hi,

com.mybrand.SchedulerService is a osgi service, you can unregister this service to terminate existing jobs.

Slingscheduler are not persistent so it must go away once service in unregistered.

you can try stop and start this component from http://localhost:4502/system/console/components 



Arun Patidar

Avatar

Correct answer by
Employee Advisor

Are you planning to do it permanently? 

 

As @arunpatidar has mentioned if we stop the Scheduler via http://localhost:4502/system/console/components 

then the relevant job will be removed from /system/console/status-slingscheduler (tested on my local AEM instance).

But once you redeploy your bundle or restart your bundle then again, this Job will be available.