Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Fix event:poll polling-interval #430

Merged
merged 3 commits into from
Nov 21, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions src/commands/events/poll.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class EventsPollCommand extends BoxCommand {
options.endDate = flags['end-date'];
}
if (flags['polling-interval']) {
options.pollingInterval = flags['polling-interval'];
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't we differentiate here the enterprise flag enabled, where for getEnterpriseEventStream method we should pass pollingInterval param, and getEventStream method where we have fetchInterval?

I'm afraid that this change will fix getEventStream but will break getEnterpriseEventStream

options.fetchInterval = flags['polling-interval'] * 1000;
}

await this.output('Polling started...');
Expand Down Expand Up @@ -56,7 +56,10 @@ EventsPollCommand.flags = {
description: 'Return enterprise events that occured before this time. Use a timestamp or shorthand syntax 00t, like 05w for 5 weeks.',
parse: input => BoxCommand.normalizeDateString(input),
}),
'polling-interval': flags.string({ description: 'Number of seconds to wait before polling for new events. Default is 60 seconds.' })
'polling-interval': flags.string({
description: 'Number of seconds to wait before polling for new events. Default is 60 seconds.',
parse: input => parseInt(input, 10),
})
};


Expand Down