forked from Kieran/snort
fixes
This commit is contained in:
parent
aa9d5d72be
commit
0307bacd30
@ -81,9 +81,7 @@ export class ProfileCacheRelayWorker extends EventEmitter<CacheEvents> implement
|
|||||||
this.emit("change", mapped);
|
this.emit("change", mapped);
|
||||||
}
|
}
|
||||||
|
|
||||||
async update<TWithCreated extends CachedMetadata & { created: number; loaded: number }>(
|
async update(): Promise<"new" | "refresh" | "updated" | "no_change"> {
|
||||||
m: TWithCreated,
|
|
||||||
): Promise<"new" | "refresh" | "updated" | "no_change"> {
|
|
||||||
// do nothing
|
// do nothing
|
||||||
return "refresh";
|
return "refresh";
|
||||||
}
|
}
|
||||||
|
@ -157,11 +157,13 @@ export class WorkerRelay extends EventEmitter<WorkerRelayEvents> {
|
|||||||
});
|
});
|
||||||
let eventInserted = (this.#db?.changes() as number) > 0;
|
let eventInserted = (this.#db?.changes() as number) > 0;
|
||||||
if (eventInserted) {
|
if (eventInserted) {
|
||||||
for (const t of ev.tags.filter(a => a[0].length === 1)) {
|
db.transaction(db => {
|
||||||
db.exec("insert into tags(event_id, key, value) values(?, ?, ?)", {
|
for (const t of ev.tags.filter(a => a[0].length === 1)) {
|
||||||
bind: [ev.id, t[0], t[1]],
|
db.exec("insert into tags(event_id, key, value) values(?, ?, ?)", {
|
||||||
});
|
bind: [ev.id, t[0], t[1]],
|
||||||
}
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
this.#seenInserts.add(ev.id);
|
this.#seenInserts.add(ev.id);
|
||||||
return eventInserted;
|
return eventInserted;
|
||||||
|
Loading…
Reference in New Issue
Block a user