How is your experience with the OutSystems Community?
70
Views
11
Comments
Multi-Tenant Timers
Application Type
Reactive
Service Studio Version
11.54.65 (Build 63363)

Hi Team,

Our multi-tenant application uses timers configured in Service Studio. We need to temporarily disable all these timers for all tenants via the service center. What's the recommended approach to achieve this? 

Thanks in advance.

2024-06-08 15-17-54
Nawaz Khan

you already mentioned in your post. Disable the timers and reactivate when required. 

if you know when you timers need to run again, then you can configure accordingly

2023-12-11 08-54-13
Neha Agrawal
Champion

I am not sure, if you are aware that the timers for multi-tenant applications are not listed in the service center timers, instead they are listed on the tenants page & we can schedule/deactivate for each timer. 
We have many tenants & this is not feasible for us to visit each tenant & disable the timers.

2024-06-08 15-17-54
Nawaz Khan

@Neha Agarwal Timers property Is multi-tenant can be marked as false to avoid run isolated against each tenant.

 if this is not what you want then I would make some DB level criteria (to make the data not available for timers) so timer can not fetch any data even running normally until it required. This approach purely depends on how the timers are fetching data.

While from service center, I don't think there is a way to disable all the timers at once in multi tenant application.

2021-09-06 15-09-53
Dorine Boudry
 
MVP

Hi Neha,

if your platform is on on-prem, you could stop the scheduler service for a while (this would of course also stop other timers from running)  don't know if that is possible for you ?

alternatively, you could try to edit the scheduler data programatically, but this is error prone if you don't know exactly what you are doing.

Dorine

2023-12-07 07-51-40
Remco Dekkinga
 
MVP

Hi Neha,

For O11 Cloud, you can use the following System entities:

The Cyclic_Job has the configuration of the Multi-tenant timers. Don't play around with this data, it could break your timers.

There is a "NextRun" date-attribute on the Cyclic_Job entity. Setting this to "01-01-3000" will disable the Timer. Don't try to change the "Schedule", since this might break your timer.

The Tenant can be used to view the Tenant Name and the Espace can be used to see the Espace Name.

You can decide if you want to make an overview only or if you want to disable and enable them programmatically.

Kind regards,

Remco

2021-09-06 15-09-53
Dorine Boudry
 
MVP

In addition to what Remco is saying,

if you don't want to develop anything, you could also use this query :

this will block your timer from running on the scheduled time, but also block anybody or any code from waking it, or anyone from using the Run Now facility (the timer even becomes invisible in service center list)

Once you put back to active though, a missed schedule or wake timer that happened while it was inactive, will cause a run.

Dorine

2024-12-10 04-40-04
Gitansh Anand

Hi @Neha Agrawal, you can create a Boolean site property then at the start of your timer you can check if the site property is set to true and only then run the logic other wise just end the flow in all your timers.

Thanks
Gitansh Anand

2023-12-11 08-54-13
Neha Agrawal
Champion

Thank you all. 
Seems that there is no way for us to disable all the timers at once in multi tenant application from Service Center or LifeTime.
The coding route is always but we didn't wanted to go that way.

Posting this on idea channel - https://www.outsystems.com/ideas/14252/play-with-configurations-of-multi-tenant-timers-for-all-tenants-in-one-go/


Thanks, 
Neha 

2024-06-08 15-17-54
Nawaz Khan

@Neha Agarwal after knowing community experts advise, we know that we have limitations here as I mentioned 


Thank you for posting the idea. it will be beneficial 

2021-01-01 09-23-30
Michael de Guzman
Champion

Hi @Neha Agrawal ,

At the moment, it is not easy to stop Timers once they've started. That's why implementing the KillSwitch pattern is highly recommended (similar to what Gitansh suggested). You can refer to this article for a solid walkthrough on using this pattern (look for AbortTimer variable): https://itnext.io/how-to-manage-heavy-timers-in-outsystems-6c954789783e

One extra tip: make your KillSwitch Site Property not multi-tenant. That way, you have a single emergency brake that takes effect across all tenants simultaneously, which is much easier to manage if you need to stop a runaway process globally.
It’s worth noting that while this still involves a bit of manual coding within your Timer logic, it’s considered a best practice to implement it anyway. It gives you much better control over your server resources and prevents you from having to wait for a 20-minute platform timeout.

I hope it helps.

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