Skip to content

Commit 33a49cf

Browse files
committed
fix(pencil): fix set expiry
1 parent 27d8b3f commit 33a49cf

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

src/action-set.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import { IPSet } from 'futoin-ipset';
2-
import SetType from './enums/set-type';
1+
import { IPSet } from "futoin-ipset";
2+
import SetType from "./enums/set-type";
33

44
export class ActionSet {
55
private multiSet: Object;
@@ -9,7 +9,7 @@ export class ActionSet {
99
}
1010

1111
public add(setType: SetType, item: string, ts?: number, ttl?: number) {
12-
const expireTs = (ts && ttl !== -1) ? ts + ttl * 1000 : -1;
12+
const expireTs = ts && ttl !== -1 ? ts + ttl * 1000 : -1;
1313
const set = this.getSet(setType);
1414

1515
if (setType === SetType.IP) {
@@ -68,7 +68,7 @@ export class ActionSet {
6868
ip: new IPSet(),
6969
path: new Map<string, Number>(),
7070
user: new Map<string, Number>(),
71-
country: new Map<string, Number>()
71+
country: new Map<string, Number>(),
7272
};
7373
}
7474

@@ -102,7 +102,7 @@ export class ActionSet {
102102

103103
for (let [sub, m] of set._v6._pm) {
104104
for (let key of m.keys()) {
105-
set.has(key + "/" + sub);
105+
this.has(setType, key + "/" + sub);
106106
}
107107
}
108108
} else {

0 commit comments

Comments
 (0)