Process Restart Values and Frequency
Learn about process restart values and restart frequency to control processes' shut downs and restarts.
We'll cover the following
Process restart values revisited
By default, GenServer
processes are always restarted by their supervisor, which is the :permanent
setting. In our case, we intentionally shut down the process. However, JobRunner
thinks something must have gone wrong, so it keeps restarting the process forever. We can easily fix this by using the :transient restart
option, which tells the supervisor not to restart the process if it is exiting normally.
We have modified the use GenServer
statement in job.ex
file for the new setting:
Get hands-on with 1300+ tech skills courses.