VBT.Accounts.Token.Cleanup (vbt v0.1.0) View Source

Periodical database cleanup of expired and used tokens.

To run this process, include {VBT.Accounts.Token.Cleanup, opts} as a child in your supervision tree.

Options:

  • :config - Accounts configuration (VBT.Accounts.config()). This parameter is mandatory.
  • :id - Supervisor child id of the process. Defaults to VBT.Accounts.Token.Cleanup.
  • :every - Cleanup interval. Defaults to 10 minutes.
  • :timeout - Maximum allowed duration of a single cleanup. Defaults to 1 minute.
  • :retention - The period during which expired and used tokens are not deleted. Defaults to 7 days.
  • :name, :telemetry_id, :mode - Periodic-specific options. See [Periodic docs] (https://hexdocs.pm/parent/Periodic.html#module-options) for details.

All of the time options should be provided in milliseconds.

Link to this section Summary

Link to this section Types

Specs

opts() :: [
  id: any(),
  name: GenServer.name(),
  every: pos_integer(),
  timeout: pos_integer(),
  retention: pos_integer(),
  config: VBT.Accounts.config(),
  telemetry_id: any(),
  resolve_pid: (() -> pid()),
  mode: :auto | :manual
]

Link to this section Functions

Specs

child_spec(opts()) :: Supervisor.child_spec()