Magento 2 Commerce Cloud CRON Configuration
Magento Commerce Cloud used YML file to set up CRON jobs in lower level environments.
To enable these same CRON jobs in your Staging and Production environments, you will have to submit Magento a ticket. This process is still manual, unfortunately.
Example (for PowerSync connector version 2.7 and above)
This is the latest version of PowerSync connector
Add the following cron jobs to your .magento.app.yaml file:
# PowerSync Magento 2 cron jobs
crons:
sforce-incoming:
spec: "*/5 * * * *"
cmd: "php bin/magento tnw_salesforce:cron:run incoming -a"
sforce-queue-cleanup:
spec: "* * * * *"
cmd: "php bin/magento tnw_salesforce:clean:queue"
sforce-log-cleanup:
spec: "*/5 * * * *"
cmd: "php bin/magento tnw_salesforce:clean_system_logs"
cronrun_consumers_group:
spec: "* * * * *"
cmd: "php bin/magento cron:run --group consumers"
tnw_salesforce_crons_group:
spec: "* * * * *"
cmd: "php bin/magento cron:run --group tnw_salesforce_crons"You also may need to make the following modifications in your .magento.env.yaml file
set the CONSUMERS_WAIT_FOR_MAX_MESSAGES to true
add the following consumers to the appropriated section:
tnwSalesforceSyncRealtimeAmqp
tnwSalesforceSyncRealtimeDb
tnwSalesforcePrequeueProcessDb
tnwSalesforceQueueProcessBackgroundDb
tnwSalesforceQueueProcessNormalDb
tnwSalesforcePrequeueProcessAmqp
tnwSalesforceQueueProcessBackgroundAmqp
tnwSalesforceQueueProcessNormalAmqp
tnwSalesforceQueueProcessCheckNormalDb
tnwSalesforceQueueProcessCheckNormalAmqp
tnwSalesforceQueueProcessCheckBackgroundDb
tnwSalesforceQueueProcessCheckBackgroundAmqp
tnwSalesforceSyncQuoteDb
tnwSalesforceSyncQuoteAmqp
tnwCountryStateUpdateConsumerDb
tnwCountryStateUpdateConsumerAmqp
An example:
.magento.env.yaml
stage:
global:
SKIP_HTML_MINIFICATION: true
build:
SKIP_SCD: true
SCD_STRATEGY: "compact"
deploy:
CONSUMERS_WAIT_FOR_MAX_MESSAGES: true
MYSQL_USE_SLAVE_CONNECTION: true
CRON_CONSUMERS_RUNNER:
cron_run: true
max_messages: 1000
consumers:
- sharedCatalogUpdatePrice
- sharedCatalogUpdateCategoryPermissions
- async.operations.all
- codegeneratorProcessor
- exportProcessor
- quoteItemCleaner
- inventoryQtyCounter
- tnwSalesforceSyncRealtimeAmqp
- tnwSalesforceSyncRealtimeDb
- tnwSalesforcePrequeueProcessDb
- tnwSalesforceQueueProcessBackgroundDb
- tnwSalesforceQueueProcessNormalDb
- tnwSalesforcePrequeueProcessAmqp
- tnwSalesforceQueueProcessBackgroundAmqp
- tnwSalesforceQueueProcessNormalAmqp
- tnwSalesforceQueueProcessCheckNormalDb
- tnwSalesforceQueueProcessCheckNormalAmqp
- tnwSalesforceQueueProcessCheckBackgroundDb
- tnwSalesforceQueueProcessCheckBackgroundAmqp
- tnwSalesforceSyncQuoteDb
- tnwSalesforceSyncQuoteAmqp
- tnwCountryStateUpdateConsumerDb
- tnwCountryStateUpdateConsumerAmqp
Example (for PowerSync connector version 2.5 - 2.6 )
# PowerSync Magento 2 cron jobs
crons:
sforce-background:
spec: "*/5 * * * *"
cmd: "php bin/magento tnw_salesforce:cron:run background -a -p"
sforce-incoming:
spec: "*/5 * * * *"
cmd: "php bin/magento tnw_salesforce:cron:run incoming -a"
sforce-outgoing:
spec: "*/5 * * * *"
cmd: "php bin/magento tnw_salesforce:cron:run outgoing -a -p"
sforce-background-check:
spec: "*/5 * * * *"
cmd: "php bin/magento tnw_salesforce:cron:run background -a -c"
sforce-incoming-check:
spec: "*/5 * * * *"
cmd: "php bin/magento tnw_salesforce:cron:run outgoing -a -c"
sforce-prequeue:
spec: "*/5 * * * *"
cmd: "php bin/magento tnw_salesforce:cron:prequeue"
sforce-queue-cleanup:
spec: "* * * * *"
cmd: "php bin/magento tnw_salesforce:clean:queue"
sforce-log-cleanup:
spec: "*/5 * * * *"
cmd: "php bin/magento tnw_salesforce:clean_system_logs"