Skip to content

endlessloop-pt/ecto_connection_resetter

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

EctoConnectionResetter

An OTP process that allows a user to add one line to create a cron job to call disconnect all every X minutes.

Usage

In your application.ex, add:

def start(_type, _args) do
  ...

  children = [
    ...
    {EctoConnectionResetter, %{cycle_mins: 1, close_interval: 1, repo: YourRepo}}
  ]

  ...
end

where:

  • cycle_mins: number of minutes between each cycle.
  • close_interval: seconds to close once a disconnect_all is called.
  • repo: your Repo.

Installation

If available in Hex, the package can be installed by adding ecto_connection_resetter to your list of dependencies in mix.exs:

def deps do
  [
    {:ecto_connection_resetter, "~> 0.1.1"}
  ]
end

Documentation can be generated with ExDoc and published on HexDocs. Once published, the docs can be found at https://hexdocs.pm/ecto_connection_resetter.

Releases

No releases published

Packages

No packages published

Languages

  • Elixir 97.5%
  • Makefile 2.5%