# `CredoHotUpgrades.Check.LocalAcceptLoop`
[🔗](https://github.com/deployex/credo_hot_upgrades/blob/main/lib/credo_hot_upgrades/check/local_accept_loop.ex#L1)

## Basics

> #### This check is disabled by default. {: .neutral}
>
> [Learn how to enable it](`e:credo:config_file.html#checks`) via `.credo.exs`.

This check has a base priority of `high` and works with any version of Elixir.

## Explanation

The same problem as a local receive loop, for a process that waits in
`:gen_tcp.accept/1,2`, `:ssl.transport_accept/1,2` or `:socket.accept/1,2`
instead of `receive`:

    defp accept_loop(listen) do
      {:ok, socket} = :gen_tcp.accept(listen)
      serve(socket)
      accept_loop(listen)   # never leaves the old code
    end

This process is not a `gen_server`, so it cannot be suspended, and a bare
recursive call stays on the code version it started on, blocking the
next deploy's purge. Call `__MODULE__.accept_loop(listen)`, or let
ThousandIsland or Ranch own the loop instead.

## Check-Specific Parameters

*There are no specific parameters for this check.*

## General Parameters

Like with all checks, [general params](`e:credo:check_params.html`) can be applied.

Parameters can be configured via the [`.credo.exs` config file](`e:credo:config_file.html`).

---

*Consult [api-reference.md](api-reference.md) for complete listing*
