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

Handle auto-close when system clock is after auto-close-time and no d… #139

Merged
merged 2 commits into from
Dec 8, 2020

Conversation

danada
Copy link
Contributor

@danada danada commented Dec 8, 2020

…ata is being received.

WIP because of all the comments and logging, will clean it up.

This introduces a new boolean dataStopped that once true and no data is being received stops the autoCloseTimer from being reset. This means the cli will wait auto-close-duration then close when the system clock is after auto-close-time and no data is being received. Previously this case would close at the time data stopped being received + system latency + auto-close-delay.

I also moved the dataStarted logic to the top layer of the if statements in an attempt to solve the timer reset logic.

@rockets3600
Copy link
Contributor

It's hard to unpack all of the logic and analyze it statically, but given that your tests were good, I think this is good to merge. Maybe try with no data at all in one of the tests to cover that case?

@rockets3600 rockets3600 marked this pull request as ready for review December 8, 2020 04:33
@danada
Copy link
Contributor Author

danada commented Dec 8, 2020

@rockets3600 thanks for taking a look. I ran a test with no data whatsoever and it exited at the specified auto-close-time + auto-close-delay.

@danada danada merged commit ad49be0 into infostellarinc:master Dec 8, 2020
@danada danada deleted the auto-close-refactor branch December 8, 2020 06:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants