Skip to content

Commit

Permalink
Fix blocking event loop test failure
Browse files Browse the repository at this point in the history
By replacing 'check-internet-connected' package
  • Loading branch information
haimkastner committed Mar 1, 2020
1 parent 1df21f0 commit 9e82f23
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 81 deletions.
105 changes: 27 additions & 78 deletions backend/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion backend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@
"body-parser": "^1.19.0",
"chai": "^4.2.0",
"chai-http": "^4.3.0",
"check-internet-connected": "^2.0.4",
"child-process-promise": "^2.2.1",
"cookie-parser": "^1.4.4",
"crypto-js": "^3.1.9-1",
Expand All @@ -60,6 +59,7 @@
"http": "0.0.0",
"https": "^1.0.0",
"ip": "^1.1.5",
"is-online": "^8.2.1",
"joi": "^14.3.0",
"log4js": "^3.0.6",
"macaddress": "^0.2.9",
Expand Down
4 changes: 2 additions & 2 deletions backend/src/utilities/lanManager.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as checkInternetConnected from 'check-internet-connected';
import * as ip from 'ip';
import * as isOnline from 'is-online';
import * as networkList2 from 'network-list2';
import { Configuration } from '../config';
import { LocalNetworkDevice } from '../models/sharedInterfaces';
Expand All @@ -15,7 +15,7 @@ export const LocalNetworkReader = (): Promise<LocalNetworkDevice[]> => {
const ops: { ip?: string; vendor?: boolean } = {};

/** Check if internet connection is online, otherwise don't try to get vendor name. */
const isInternetOnline = await checkInternetConnected();
const isInternetOnline = await isOnline();

if (Configuration.scanSubnet) {
ops.ip = Configuration.scanSubnet;
Expand Down

0 comments on commit 9e82f23

Please sign in to comment.