Skip to content

Conversation

@noliveleger
Copy link
Contributor

It can submit data to kpi to let kpi transfer it to remote servers

@noliveleger noliveleger requested a review from jnm September 25, 2018 20:29
@jnm
Copy link
Member

jnm commented Sep 25, 2018

I left the one comment for possible performance improvement, but I wouldn't block the merge as-is. @noliveleger, you'll probably get around to tweaking it before I finish reviewing the KPI branch ;)

offset = 0
while stop is not True:
limit = offset + batchsize
instances_ids = Instance.objects.values_list("id", flat=True)[offset:limit]
Copy link
Member

Choose a reason for hiding this comment

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

Ah, I forgot about this—adding it as a requested change. I think the queryset should be ordered explicitly by pk (or id) when using this kind of chunking. Otherwise, I think the order of values returned will be undefined.

@jnm jnm merged commit f73476d into master Oct 2, 2018
@jnm jnm deleted the kpi_rest_services branch October 2, 2018 18:07
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.

3 participants