-
Notifications
You must be signed in to change notification settings - Fork 651
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
Prevent polling requests from being queued up #4980
Conversation
… should be invoked on every cycle
…nfiguration for each type of model
Frontend tests were OK 👍 (details) |
return model.hasFailed() || model.hasCompleted(); | ||
}, | ||
error: function() { | ||
this.model.trigger("change"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what's the reason for using this.model
and not just model
, like done in condition
fn above?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch! I thought about this but then forgot to revisit it. There's no specific reason.
I will also pass model
to the error
callback so that there's no need to know about the internals of the Poller:
...
error: function(model) {
model.trigger("change");
}
...
Apart from comments it LGTM 👍 |
Prevent polling requests from being queued up
Fixes #4939.
I've basically extracted some of the polling logic from
GeocodingModel
andImportModel
intoGeocodingModelPoller
andImportModelPoller
, which are specifications of a genericPoller
. Instead of using an interval to triggerfetch
requests periodically, pollers now wait for the previous request to be received before triggering new ones :)@viddo could please take a look? I'm looking forward for your feedback! Thanks!