Quantum.RunStrategy.Random (Quantum v3.4.0) View Source

Run job on one node of the list randomly.

If the node list is :cluster, one node of the cluster will be used.

This run strategy also makes sure, that the node doesn't run in two places at the same time if job.overlap is falsy.

Mix Configuration

config :my_app, MyApp.Scheduler,
  jobs: [
    # Run on any node in cluster
    [schedule: "* * * * *", run_strategy: {Quantum.RunStrategy.Random, :cluster}],
    # Run on any node of given list
    [schedule: "* * * * *", run_strategy: {Quantum.RunStrategy.Random, [:"node@host1", :"node@host2"]}],
  ]