Skip to content

Commit

Permalink
Document event_cleaning_interval and event_max_age options
Browse files Browse the repository at this point in the history
  • Loading branch information
arcusfelis committed Mar 9, 2021
1 parent 8e5903a commit 8fd9252
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 1 deletion.
18 changes: 18 additions & 0 deletions doc/modules/service_domain_db.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,24 @@ The database schema contains two tables:

We use `id` field to sort records when paginating.

## Service options

### `event_cleaning_interval`

The number of seconds between cleaning attempts of the `domain_events` table.

* **Syntax:** positive integer
* **Default:** `1800` (30 minutes)
* **Example:** `event_cleaning_interval = 1800`

### `event_max_age`

The number of seconds after an event must be removed from the `domain_events` table.

* **Syntax:** positive integer
* **Default:** `7200` (2 hours)
* **Example:** `event_max_age = 7200`

# REST API

We must provide REST API for Add/Remove and Enable/Disable interfaces of the
Expand Down
7 changes: 6 additions & 1 deletion src/domain/service_domain_db.erl
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,12 @@ stop() ->

-spec config_spec() -> mongoose_config_spec:config_section().
config_spec() ->
#section{items = #{}}.
#section{items = #{
<<"event_cleaning_interval">> => #option{type = integer,
validate = positive},
<<"event_max_age">> => #option{type = integer,
validate = positive}
}}.

start_link() ->
gen_server:start_link({local, ?MODULE}, ?MODULE, [], []).
Expand Down

0 comments on commit 8fd9252

Please sign in to comment.