147
Views
5
Comments
Solved
Default timer schedule "When published" can't be changed
Application Type
Service
Service Studio Version
11.53.16 (Build 61265)
Platform Version
11.17.0 (Build 36348)

Hi, I have a timer for bootstrapping an entity so that is scheduled  "When publishing".

Despite the fact that the timer has a control to leave if it detects that it has already been executed, I wanted to deactivate it.

For that I have setup another schedule: daily at 23:00 and deactivate it.

When I enter in the timer screen in service center I can see the warning "This timer is deactivated". the situation is like this:

  Then, in Service Studio, I set a breakpoint on that timer's logic, then started the debugger and published the module. The break point was reached so the timer ran even though it had a different schedule (and was disabled). Upon returning to the service center, I found that the timer was reactivated (according to this article, if you manually run a disabled timer, the timer is reactivated, so the same thing happened here, but it was the schedule service that executed the timer ).


It's as if the schedule service were ignoring the effective schedule as well as the fact that the timer were deactivated.

So there's no way to setup and effective schedule (neither deactivate the timer) in service center when the default schedule is  "When published".

Is there an explanation for this or should the schedule service had taken into account the effective schedule?


  

2020-09-15 13-07-23
Kilian Hekhuis
 
MVP
Solution

I checked Service Center, and indeed saw "When Published" as "Default Schedule", so I now understand your confusion. "When Published" isn't a "normal" default schedule however, it's something that's checked by the deployment service (I think that's what it's called), before the scheduler service even comes into play.

So what you want isn't possible. The timer will run when published, disregarding any schedule. Think of it as a manually started timer run, except it's started by the deployment service.

2020-09-15 13-07-23
Kilian Hekhuis
 
MVP

Hi Roberto,

If you set the schedule to "when published", the Platform will schedule the timer after the module has been published (and when another tenant is created for multi-tenant modules). I haven't investigated in detail how the Platform does this, but I think it just does the same thing as a manual run, i.e. set a Next Run of the current date/time. So it's not the Scheduler Service that "ignores the effective schedule", but it just sees it should run the timer immediately, per the current Next Run date/time.

I'm not sure where your confusion lies - if you indicate a timer should run whenever the module is published, and it actually does so, what's the issue? There's indeed no way to prevent this, but there needn't be, in my opinion. It's easy to check whether it should run, and once the module is in production you can remove the timer entirely on the development environment so next time there will be no timer to run.

2022-09-14 15-31-13
Roberto García

Hi Kilian, 

The confussion: if there is a possibility to change the default schedule, so I can set a new effective schedule and even deactivate the timer, that should work over the default schedule, that's what I expect as well as for integrations or site properties. An idea is to hide or disable the effective schedule when the default schedule is "When published" (or at least the documentation could describe that exception so that one knows what to expect). 




2020-09-15 13-07-23
Kilian Hekhuis
 
MVP
Solution

I checked Service Center, and indeed saw "When Published" as "Default Schedule", so I now understand your confusion. "When Published" isn't a "normal" default schedule however, it's something that's checked by the deployment service (I think that's what it's called), before the scheduler service even comes into play.

So what you want isn't possible. The timer will run when published, disregarding any schedule. Think of it as a manually started timer run, except it's started by the deployment service.

2022-09-14 15-31-13
Roberto García

Ok, understood.

Thanks Kilian

2020-09-15 13-07-23
Kilian Hekhuis
 
MVP

You're most welcome. Sorry I couldn't find a better solution 😄.

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.