Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cronjob mautic:import won't work properly if added in cron/mautic #269

Open
audacioustux opened this issue Feb 24, 2024 · 1 comment
Open

Comments

@audacioustux
Copy link

The cron container do not have access to the var/tmp/imports folder. so, it needs to be added / shared with both mautic_web and cron container.

Also, I think it's good to have all the mautic crons automatically be set-up, not just the 3 currently has, with a generic limits/configs, by default.

And I think usage of supervisord may backfire (just assuming), as it'll crash completely (correct me if I'm wrong) after 10 retries... and AFAIK there's no "indefinitely retry" settings in supervisord. So, if for example, I change the queue settings to sync://, the supervisord services may crash (and potentially be retried with docker-compose restart: always policy, but is that ideal?)

@sandrociceros-orquestra

I also detected this need for enhancement because the files sent for import are generated in the "mautic_web" container.

I tried to add a shared volume between the "mautic_web" and "mautic_cron" services in the "x-mautic-volumes" section of the file docker-compose.yml but the "mautic_web" service fails.

To work around the case I added in the "mautic_web" service the execution of the job "mautic:import" in crontab:

    command: >
      bash -c '
      apt-get update && apt-get install -y cron &&
      echo "*/5 * * * * /usr/local/bin/php /var/www/html/bin/console mautic:import >> /tmp/stdout 2>&1" > /etc/cron.d/mautic-cron &&
      chmod 0644 /etc/cron.d/mautic-cron &&
      crontab /etc/cron.d/mautic-cron &&
      touch /tmp/stdout &&
      (cron -f | tail -f /tmp/stdout) &
      apache2-foreground'

Works like a charm, but I don't think it's the proper solution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants