AAAA
This commit is contained in:
parent
f0206fae4e
commit
7f25924206
4
index.js
4
index.js
|
@ -105,8 +105,8 @@ async function checkForNewEndpoints() {
|
||||||
let newContacts = [];
|
let newContacts = [];
|
||||||
for (const endpoint of parsed) {
|
for (const endpoint of parsed) {
|
||||||
const seen = await db.getObjectDefault(`/seen/${endpoint.endpoint}`, []);
|
const seen = await db.getObjectDefault(`/seen/${endpoint.endpoint}`, []);
|
||||||
const newEndpointContacts = endpoint.contacts.filter(contact => !seen.includes(contact.host.split(":")[0]));
|
const newEndpointContacts = endpoint.contacts.filter(contact => !seen.includes(contact.host?.split(":")[0]));
|
||||||
const uniqueHosts = [...new Set(newEndpointContacts.map(contact => contact.host.split(":")[0]))];
|
const uniqueHosts = [...new Set(newEndpointContacts.map(contact => contact.host?.split(":")[0]))];
|
||||||
uniqueHosts.forEach(host => {
|
uniqueHosts.forEach(host => {
|
||||||
db.push(`/seen/${endpoint.endpoint}[]`, host);
|
db.push(`/seen/${endpoint.endpoint}[]`, host);
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in a new issue