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

add initial batch_apex_wait task #372

Merged
merged 3 commits into from Jul 7, 2017
Merged

Conversation

cdcarter
Copy link
Contributor

@cdcarter cdcarter commented Jul 7, 2017

Critical Changes

Changes

Adds a new task class cumulusci.tasks.batch_apex.BatchApexWait that blocks until a batch job completes.

Usage:
cci task run batch_apex_wait -o class_name BDI_DataImport_Batch.

2017-07-07 13:14:01: Running task: batch_apex_wait
2017-07-07 13:14:02: Options:
2017-07-07 13:14:02:   class_name: BDI_DataImport_BATCH
2017-07-07 13:14:02: Beginning task: BatchApexWait
2017-07-07 13:14:02:
2017-07-07 13:14:08: BDI_DataImport_BATCH: 1 of 20 (0 failures)
2017-07-07 13:14:10: BDI_DataImport_BATCH: 1 of 20 (0 failures)
2017-07-07 13:14:12: Increased polling interval to 3 seconds
[...]
2017-07-07 13:15:54: Increased polling interval to 9 seconds
2017-07-07 13:15:54: BDI_DataImport_BATCH: 20 of 20 (0 failures)
2017-07-07 13:15:54: Job is complete.
2017-07-07 13:15:54: BDI_DataImport_BATCH took 108 seconds to process 20 batches
2017-07-07 13:15:54: Task complete: batch_apex_wait

The task will wait for the most recently submitted batch job for that class_name to complete. This task assumes nobody else is running this class in this org. Be careful in shared orgs.

Issues Closed

@cdcarter cdcarter requested a review from cpolcyn July 7, 2017 20:30
@cdcarter
Copy link
Contributor Author

cdcarter commented Jul 7, 2017

hey @cpolcyn - I'd love a review when you get a chance.

Additionally, let me know of any opportunities you see for an appropriate unit test? this task is mostly dependent on the poll mechanism but should probably test a success and a failure.

Copy link
Contributor

@cpolcyn cpolcyn left a comment

Choose a reason for hiding this comment

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

Nice!

'LIMIT 1'.format(self.options['class_name'])


def _try(self):
Copy link
Contributor

Choose a reason for hiding this comment

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

Could be removed? I think self._retry() is never called anyway.

@cdcarter cdcarter assigned cdcarter and jlantz and unassigned cdcarter Jul 7, 2017
@cdcarter
Copy link
Contributor Author

cdcarter commented Jul 7, 2017

@jlantz - assigned to you to merge

nvm, chris gave me the 👍

@cdcarter cdcarter merged commit 4e70c77 into master Jul 7, 2017
@cdcarter cdcarter deleted the feature/batch_apex_wait branch July 7, 2017 22:24
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.

None yet

3 participants