antiDuplicationPolicy refactor opts
This commit is contained in:
parent
b32bfef342
commit
37213aec65
@ -17,9 +17,11 @@ interface AntiDuplication {
|
|||||||
* Only messages that meet the minimum length criteria are selected.
|
* Only messages that meet the minimum length criteria are selected.
|
||||||
*/
|
*/
|
||||||
const antiDuplicationPolicy: Policy<AntiDuplication> = async (msg, opts = {}) => {
|
const antiDuplicationPolicy: Policy<AntiDuplication> = async (msg, opts = {}) => {
|
||||||
const ttl = opts.ttl ?? 60000;
|
const {
|
||||||
const minLength = opts.minLength ?? 50;
|
ttl = 60000,
|
||||||
const databaseUrl = opts.databaseUrl ?? 'sqlite:///tmp/strfry-anti-duplication-policy.sqlite3';
|
minLength = 50,
|
||||||
|
databaseUrl = 'sqlite:///tmp/strfry-anti-duplication-policy.sqlite3',
|
||||||
|
} = opts;
|
||||||
|
|
||||||
const { kind, content } = msg.event;
|
const { kind, content } = msg.event;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user