OroCommerce Forums

Covering OroCommerce topics, including community updates and company announcements.

Forums Forums OroCommerce Cam I pass parameter to my custome schedule job

This topic contains 2 replies, has 2 voices, and was last updated by  Ayman Hussein 6 years, 1 month ago.

Starting from March 1, 2020 the forum has been switched to the read-only mode. Please head to StackOverflow for support.

  • Creator
    Topic
  • #32818

    Ayman Hussein
    Participant

    I have created new schedule job ‘watcher-job’ and I override execute function inside WatcherJobCommand class, Now I need to implement my logic inside it depends on types like:

    can i pass new param to when call oro:cron:watcherjob and catch it in execute function.

    Thanks,
    Ayman


    arh922

Viewing 2 replies - 1 through 2 (of 2 total)
  • Author
    Replies
  • #32819

    vseniuk
    Participant

    Hello Ayman,

    Please look at this example:

    We have a console command that was created according to the documentation and it implements \Oro\Bundle\CronBundle\Command\CronCommandInterface.

    This command will be executed by cron every minute. If you want pass some options to it, you should define them as a defaults:

    Now command will be executed by cron every minute with type=1. Also you can execute this command manually and put another value of option type. Example: app/console oro:cron:example --type=2.

    You cannot executed command by cron with dynamic option.

    #32820

    Ayman Hussein
    Participant

    Thank you @vseniuk, I got it.


    arh922

Viewing 2 replies - 1 through 2 (of 2 total)

The forum ‘OroCommerce’ is closed to new topics and replies.

Back to top