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

Allow change pool time seconds at WaitForReport. #554

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions googleads/ad_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -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, pollTimeSeconds = 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
gbretas marked this conversation as resolved.
Show resolved Hide resolved
generating before timing out. Defaults to 30 seconds.

Returns:
The completed report job's ID as a string.
Expand All @@ -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)
gbretas marked this conversation as resolved.
Show resolved Hide resolved
status = service.getReportJobStatus(report_job_id)

if status == 'FAILED':
Expand Down