Trigger scheduler once after deployment | Community
Skip to main content
February 9, 2018
Solved

Trigger scheduler once after deployment

  • February 9, 2018
  • 16 replies
  • 8246 views

Hi guys,

is it possible to trigger a scheduler once after every deployment? So the regular schedule time is 4 hours, but it will took 4 hours for the first run.

Any property to set?

Br,

Tim

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by joerghoh

Hi,

I see. The only chance to get it working the way you want is to trigger the scheduled job manually on activation of a SCR component/service.

Jörg

16 replies

smacdonald2008
February 10, 2018

This is an interesting use case - when you setup a scheduler to fire every 4 hours - the first time it will count 4 hours.  See if you can modify the code to fire once 1 when its activated.

joerghoh
Adobe Employee
joerghohAdobe EmployeeAccepted solution
Adobe Employee
February 10, 2018

Hi,

I see. The only chance to get it working the way you want is to trigger the scheduled job manually on activation of a SCR component/service.

Jörg

February 11, 2018

Yes that what i thought, but then it will block all other components on startup because its maybe running for 30 minutes. So no chance to do it this way. I have to create a new Service and trigger it by a custom scheduler.

Thanks for all replies.

joerghoh
Adobe Employee
Adobe Employee
February 13, 2018

I don't think that you need to do this. You can use the Scheduler API to immediately fire an event. But yes, you need to trigger that in an activate method.

Jörg

February 14, 2018

So would it come down to the example I provided? (More or less)

joerghoh
Adobe Employee
Adobe Employee
February 14, 2018

I guess so. But please validate, that the case of some activations/deactivations of the component in a short time is handled properly :-) Depending on your deployment processes this might happen.

Jörg