CMC Crons update for multiple instances
In CMC and Core projects we need to change a few things so that we can work on multiple instances. The changes are explained in two parts. First is what will change for the usage of the crons. Second is the technical explanation of what needs to be done now and in future tasks, to be kept in mind. These changes will require some change in the way deployer is handling mysql installation
For usage:
Every cron will require the name of the client as the first parameter after the cron name. This applies to manual running and in the Crontab Group and lines in them. The change needs to be where the cron is explained and needs the value of the client at the end. If we want it to run for all clients we need to add all
after the cron name or leave empty. Client names will be in hub_alpha > client > clientName. Clients that will be skipped are default
which is the main database that points to the rest and any with the suffix “_mysqli”. For a wrong name a warning is to be displayed (with LogWarning). No need to log it anywhere in the database this can happen only manually.
For tech:
- OLD is the name of the client setup to work with the current
hub
database
CronLoaderChecker - We need to check if the cron runs for a specific instance.
Core/Cron - in the construct we need to check if it runs for the specific instance not just if the cron runs at all. If the client is missing from the database then print Missing Client.
In the run we need to change only if it runs for multiple instances. we need to start the crons in the background for every client, except for default that is hub_alpha and any that are “_mysqli”, and keep every other setting that was provided for them (parameters of the cron). In devmode we can just show which cron is run with the command that was used.
LocalSettings - we need to remove the option for the same instance when updating. We can create a script to update this so we do not do it by hand.
Deployer - Changes in the deployment should be done as well. We need to change how queries work. When specified “USE hub
” will be an issue. We need to change installation to work per client and the setup.versionMap.sql to also be per client. Some instalations may pass on some clients others may not.
CMC Projects - We need to update all current crontab sqls to run for OLD only, as they do now. And check for overwrites of the run function as it will carry 90% of the work for this