Skip to content

Adds pagination and command line parameters.#9290

Merged
ashercodeorg merged 1 commit into
stagingfrom
usePagination
Jul 1, 2016
Merged

Adds pagination and command line parameters.#9290
ashercodeorg merged 1 commit into
stagingfrom
usePagination

Conversation

@ashercodeorg

Copy link
Copy Markdown
Contributor

No description provided.

DB[:poste_deliveries].where(id: delivery[:id]).update(hashed_email: hashed_email)
DB[:poste_deliveries].
where(id: delivery[:id]).
update(hashed_email: hashed_email)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Note the inner loop does not inspect end_index so this is a bit misleading. If start_index + batch_size > end_index then records past end_index will be updated.

It is fairly harmless though since the operation is idempotent.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yep, I'm cognizant of this. Doesn't seem worth it, given that this is a oneoff script.

@aoby

aoby commented Jul 1, 2016

Copy link
Copy Markdown
Contributor

LGTM, noting that the pagination doesn't exactly behave as expected but it's ok for a one-off.

@ashercodeorg ashercodeorg merged commit 67109d0 into staging Jul 1, 2016
@ashercodeorg ashercodeorg deleted the usePagination branch July 1, 2016 16:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants