why should you avoid scheduling a timer to run when published
Application Type
Traditional Web

why should avoid scheduling a timer to run when published?

I have following option

1] The timer will not be able to run manually if needed

2] Timer will run whenever the module id republished leading to unintended changes to the system.

3] The timer will not re-run should it fail.

4] The timer will not run optimally.


I think 2 option is correct. 

mvp_badge
MVP

Hello Pradip,

In my opinion, you should avoid this sort of scheduling for Timers because it's a bit of an antipattern - most developers will not expect that publishing a module can also execute logic related to your applications, potentially impacting your data. They're also very prone to be related with dead code: most of these Timers are designed to bootstrap data on an environment, so once they're executed for the first time, it's very common that they'll never be relevant again.

This doesn't mean that they should never be created - but care should be taken to ensure that they can be executed repeatedly.

I have following option

1] The timer will not be able to run manually if needed

2] Timer will run whenever the module id republished leading to unintended changes to the system.

3] The timer will not re-run should it fail.

4] The timer will not run optimally.


I think 2 option is correct. 

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