Welcome Guest, Not a member yet? Register   Sign In
Where is the Best Place for Cron Methods ?
#4

(This post was last modified: 02-16-2023, 02:51 PM by evansharp. Edit Reason: clarity )

You should follow a DRY (Don't Repeat Yourself) approach to these methods. If they're actions only performed by the cron job via you cron controller, then I'd say writing a private cron controller method to perform them makes sense. If these are methods that properly belong in another class because of the resources they need or semantics, then you could look at calling them statically from the cron controller or else instantiating their class in the cron controller.

In any event, don't create duplicates of the methods. Put them somewhere according to where they fit. Namespacing makes this pretty painless.
Reply


Messages In This Thread
RE: Where is the Best Place for Cron Methods ? - by evansharp - 02-16-2023, 02:49 PM



Theme © iAndrew 2016 - Forum software by © MyBB