diff --git a/cron-command.php b/cron-command.php index 770e5db..78cd941 100644 --- a/cron-command.php +++ b/cron-command.php @@ -4,8 +4,12 @@ return; } +if ( ! defined( 'EE_CRON_SERVICE' ) ) { + define( 'EE_CRON_SERVICE', 'global-cron' ); +} + if ( ! defined( 'EE_CRON_SCHEDULER' ) ) { - define( 'EE_CRON_SCHEDULER', 'ee-cron-scheduler' ); + define( 'EE_CRON_SCHEDULER', 'services_global-cron_1' ); } $autoload = dirname( __FILE__ ) . '/vendor/autoload.php'; diff --git a/src/Cron_Command.php b/src/Cron_Command.php index f292ef5..0d1b66c 100644 --- a/src/Cron_Command.php +++ b/src/Cron_Command.php @@ -69,9 +69,7 @@ class Cron_Command extends EE_Command { public function create( $args, $assoc_args ) { if ( 'running' !== EE_DOCKER::container_status( EE_CRON_SCHEDULER ) ) { - $img_versions = \EE\Utils\get_image_versions(); - $cron_scheduler_run_command = 'docker run --name ' . EE_CRON_SCHEDULER . ' --restart=always -d -v ' . EE_ROOT_DIR . '/services/cron:/etc/ofelia:ro -v /var/run/docker.sock:/var/run/docker.sock:ro easyengine/cron:' . $img_versions['easyengine/cron']; - if ( ! EE_DOCKER::boot_container( EE_CRON_SCHEDULER, $cron_scheduler_run_command ) ) { + if ( ! \EE\Service\Utils\init_global_container( EE_CRON_SERVICE ) ) { EE::error( 'There was some error in starting ' . EE_CRON_SCHEDULER . ' container. Please check logs.' ); } }