Skip to content

Commit

Permalink
permanent restart for the tasks
Browse files Browse the repository at this point in the history
  • Loading branch information
benonymus committed Dec 15, 2023
1 parent 7287c1c commit d2d5e01
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions lib/nsq/consumer/supervisor.ex
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,16 @@ defmodule NSQ.Consumer.Supervisor do

children = [
{NSQ.Consumer, [topic, channel, config, [name: consumer_name]]},
# Tasks have temporary restart policy by default
Supervisor.child_spec(
{Task, fn -> NSQ.Consumer.Connections.discovery_loop(consumer_name) end},
id: discovery_loop_id
id: discovery_loop_id,
restart: :permanent
),
Supervisor.child_spec(
{Task, fn -> NSQ.Consumer.RDY.redistribute_loop(consumer_name) end},
id: rdy_loop_id
id: rdy_loop_id,
restart: :permanent
)
]

Expand Down

0 comments on commit d2d5e01

Please sign in to comment.