Skip to content

Commit 19829b6

Browse files
Allow change pool time seconds at WaitForReport. (#554)
* Allow change pool time seconds at WaitForReport. * chore: fix the writing of poolTimeSeconds variable * Update googleads/ad_manager.py Co-authored-by: Chris Seeley <4163216+christopherseeley@users.noreply.github.com> * Update googleads/ad_manager.py Co-authored-by: Chris Seeley <4163216+christopherseeley@users.noreply.github.com> * Update googleads/ad_manager.py Co-authored-by: Chris Seeley <4163216+christopherseeley@users.noreply.github.com> --------- Co-authored-by: Chris Seeley <4163216+christopherseeley@users.noreply.github.com>
1 parent 981034e commit 19829b6

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

googleads/ad_manager.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -875,12 +875,14 @@ def _GetPqlService(self):
875875
'PublisherQueryLanguageService', self._version, self._server)
876876
return self._pql_service
877877

878-
def WaitForReport(self, report_job):
878+
def WaitForReport(self, report_job, pollTimeSeconds = 30):
879879
"""Runs a report, then waits (blocks) for the report to finish generating.
880880
881881
Args:
882882
report_job: The report job to wait for. This may be a dictionary or an
883883
instance of the SOAP ReportJob class.
884+
pollTimeSeconds: The number of seconds to wait between calls to getReportJobStatus
885+
generating before timing out. Defaults to 30 seconds.
884886
885887
Returns:
886888
The completed report job's ID as a string.
@@ -895,7 +897,7 @@ def WaitForReport(self, report_job):
895897

896898
while status != 'COMPLETED' and status != 'FAILED':
897899
_data_downloader_logger.debug('Report job status: %s', status)
898-
time.sleep(30)
900+
time.sleep(pollTimeSeconds)
899901
status = service.getReportJobStatus(report_job_id)
900902

901903
if status == 'FAILED':
@@ -1108,4 +1110,4 @@ def AdManagerClassType(value):
11081110
Returns:
11091111
str: A string representation of the value response type.
11101112
"""
1111-
return value.__class__.__name__
1113+
return value.__class__.__name__

0 commit comments

Comments
 (0)