Skip to main content
Level 3
Feb 9, 2018 11:10 AM UTC
Solved

Trigger scheduler once after deployment

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.
joerghoh
joerghohAccepted solution
Adobe Employee
Feb 10, 2018 8:27 PM UTC

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
Level 10
Feb 10, 2018 3:45 PM UTC

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.

Translate
joerghoh
Adobe Employee
joerghohAdobe EmployeeAccepted solution
Adobe Employee
Feb 10, 2018 8:27 PM UTC

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

Translate
Level 3
Feb 11, 2018 7:15 AM UTC

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.

Translate
joerghoh
Adobe Employee
Adobe Employee
Feb 13, 2018 8:38 PM UTC

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

Translate
Level 3
Feb 14, 2018 11:41 AM UTC

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

Translate
joerghoh
Adobe Employee
Adobe Employee
Feb 14, 2018 12:57 PM UTC

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

Translate