Skip to content

Commit

Permalink
proper timeout
Browse files Browse the repository at this point in the history
Signed-off-by: Travis Glenn Hansen <travisghansen@yahoo.com>
  • Loading branch information
travisghansen committed Jul 21, 2023
1 parent 0366684 commit 809ab5d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
# v0.4.4

Released 2023-07-21

- proper `timeout` setting for `ip` calls

# v0.4.3

Released 2023-07-21
Expand Down
6 changes: 2 additions & 4 deletions lib/ip.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const cp = require('child_process');

const DEFAULT_TIMEOUT = 30;
const DEFAULT_TIMEOUT = 10;

class IpCommand {
constructor(options = {}) {
Expand Down Expand Up @@ -190,7 +190,7 @@ class IpCommand {

exec(args, options = {}) {
if (!('timeout' in options)) {
options.timeout = DEFAULT_TIMEOUT;
options.timeout = DEFAULT_TIMEOUT * 1000;
}

const ip = this;
Expand Down Expand Up @@ -261,8 +261,6 @@ class IpCommand {
const result = {
stdout,
stderr,
timeout: false,
command: `${command} ${args.join(' ')}`,
error
};

Expand Down

0 comments on commit 809ab5d

Please sign in to comment.