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

Alternate fix for doPoll timer spam at startup #238

Merged
merged 3 commits into from
Aug 20, 2017

Conversation

welwood08
Copy link
Contributor

Polling requires an API key so there's no point running it without one. The
function that obtains said key ensures polling is started, so any other attempt
at polling without a key (such as a tradeOffers or newItems event at startup)
can be safely treated as a race condition and ignored. This re-uses the shutdown
race condition bailout by simply treating the "key not yet set" state the same
as the "key no longer set" state.

Fixes #236 #237.

@ric20007
Copy link

I tested it and it works.

DoctorMcKay and others added 2 commits July 12, 2017 21:41
Polling requires an API key so there's no point running it without one. The
function that obtains said key ensures polling is started, so any other attempt
at polling without a key (such as a tradeOffers or newItems event at startup)
can be safely treated as a race condition and ignored. This re-uses the shutdown
race condition bailout by simply treating the "key not yet set" state the same
as the "key no longer set" state.
@welwood08
Copy link
Contributor Author

Force-pushed new commits, now based on top of @Aareksio's fix after double-checking what was going on. Basically:

  • if there's no API key then bail out before setting any timer (my fix)
  • if we already spoke to the API recently, set the timer correctly (Aareksio's fix)

Copy link
Contributor

@Aareksio Aareksio left a comment

Choose a reason for hiding this comment

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

LGTM. I hope we can get it into the module this time.

@DoctorMcKay DoctorMcKay merged commit 19d5eb6 into DoctorMcKay:master Aug 20, 2017
@welwood08 welwood08 deleted the issue-236 branch August 20, 2017 14:20
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.

4 participants