ecto_job v2.1.0 EctoJob.Config View Source
EctoJob Configuration struct.
Configuration may be provided directly to your JobQueue supervisor:
supervisor(MyApp.JobQueue, [[repo: MyApp.Repo, max_demand: 100, log_level: :debug]])
Or if the configuration should be environment-specific, use Mix config:
config :ecto_job,
repo: MyApp.Repo,
max_demand: 100,
log_level: :debug
Otherwise default values will be used.
Configurable values:
repo: (Required) TheEcto.Repomodule in your application to use for accessing theJobQueuemax_demand: (Default100) The number of concurrent worker processes to use, seeConsumerSupervisorfor more detailslog: (Defaulttrue) Enables logging using the standard ElixirLoggermodulelog_level: (Default:info) The level used to log messages, see Loggerpoll_interval: (Default60_000) Time in milliseconds between polling theJobQueuefor scheduled jobs or jobs due to be retriedreservation_timeout: (Default60_000) Time in ms during which aRESERVEDjob state is held while waiting for a worker to start the job. Subsequent polls will return the job to theAVAILABLEstate for retry.execution_timeout: (Default300_000) Time in ms that a worker is allotted to hold a job in theIN_PROGRESSstate before subsequent polls return a job to theAVAILABLEstate for retry. The timeout is extended byexecution_timeoutfor every retry attempt untilmax_attempsis reached for a given job.notifications_listen_timeout: (Default5_000) Time in milliseconds that Notifications.listen!/3 is alloted to start listening to notifications from postgrex for new jobs
Link to this section Summary
Functions
Constructs a new Config from params, falling back to Application environment then to default values
Link to this section Types
Link to this section Functions
Link to this function
new(params \\ [])
View Source
new(params \\ [])
View Source
new(Keyword.t()) :: EctoJob.Config.t()
new(Keyword.t()) :: EctoJob.Config.t()
Constructs a new Config from params, falling back to Application environment then to default values.
Example
iex> EctoJob.Config.new(repo: MyApp.Repo, log: false)
%EctoJob.Config{
repo: MyApp.Repo,
max_demand: 100,
log: false,
log_level: :info,
poll_interval: 60_000,
reservation_timeout: 60_000,
execution_timeout: 300_000,
notifications_listen_timeout: 5_000
}