View Source Membrane.RTC.Engine.TimescaleDB.Cleaner (Membrane Template plugin v0.1.0)

Worker responsible for deleting obsolete records from the database. By default started under the application's supervision tree with params passed in :membreane_rtc_engine_timescaledb config (params passed in config, used to start worker, are these same, as expected by start/1 and start_link/1) start/1 and start_link/1 functions expect a keyword list as an argument, with the following keys:

  • :repo (required) is a module, that uses Ecto.Repo
  • :cleanup_interval (default: 1 hour) is the number of seconds between database cleanups
  • :metrics_lifetime (default: 24 hours) is the number of seconds that must pass from creation before each metric can be deleted during cleanup The keyword may also include GenServer options, see GenServer.option/0 for reference.

Link to this section Summary

Functions

Returns a specification to start this module under a supervisor.

Link to this section Types

@type cleaner() :: pid() | atom()
@type option() ::
  GenServer.option()
  | {:cleanup_interval, pos_integer()}
  | {:metrics_lifetime, pos_integer()}
  | {:repo, module()}
@type options() :: [option()]

Link to this section Functions

Returns a specification to start this module under a supervisor.

See Supervisor.

@spec start(options()) :: GenServer.on_start()
Link to this function

start_link(options \\ [])

View Source
@spec start_link(options()) :: GenServer.on_start()