diff --git a/googleads/ad_manager.py b/googleads/ad_manager.py index f8f5dbaa..0424b87d 100644 --- a/googleads/ad_manager.py +++ b/googleads/ad_manager.py @@ -877,12 +877,14 @@ def _GetPqlService(self): 'PublisherQueryLanguageService', self._version, self._server) return self._pql_service - def WaitForReport(self, report_job): + def WaitForReport(self, report_job, poolTimeSeconds = 30): """Runs a report, then waits (blocks) for the report to finish generating. Args: report_job: The report job to wait for. This may be a dictionary or an instance of the SOAP ReportJob class. + poolTimeSeconds: The number of seconds to wait for the report to finish + generating before timing out. Defaults to 30 seconds. Returns: The completed report job's ID as a string. @@ -897,7 +899,7 @@ def WaitForReport(self, report_job): while status != 'COMPLETED' and status != 'FAILED': _data_downloader_logger.debug('Report job status: %s', status) - time.sleep(30) + time.sleep(poolTimeSeconds) status = service.getReportJobStatus(report_job_id) if status == 'FAILED': @@ -1110,4 +1112,4 @@ def AdManagerClassType(value): Returns: str: A string representation of the value response type. """ - return value.__class__.__name__ + return value.__class__.__name__ \ No newline at end of file