Reduce frequency of port scanning

This commit is contained in:
Asher 2019-03-29 16:14:28 -05:00
parent 03ad2a17b2
commit 91deaece47
No known key found for this signature in database
GPG Key ID: 7BB4BA9C783D2BBC

View File

@ -17,7 +17,7 @@ export interface PortScanner {
* Will scan local ports and emit events when ports are added or removed.
* Currently only scans TCP ports.
*/
export const createPortScanner = (scanInterval: number = 250): PortScanner => {
export const createPortScanner = (scanInterval: number = 5000): PortScanner => {
const ports = new Map<number, number>();
const addEmitter = new Emitter<number[]>();
@ -76,6 +76,7 @@ export const createPortScanner = (scanInterval: number = 250): PortScanner => {
let disposed: boolean = false;
const doInterval = (): void => {
logger.trace("scanning ports");
scan((error) => {
if (error) {
logger.error(`Port scanning will not be available: ${error.message}.`);