Skip to content

Commit c53ce93

Browse files
author
Rodion Yaryy
committed
Remove retry logic for issues export
1 parent 773523d commit c53ce93

File tree

1 file changed

+11
-21
lines changed

1 file changed

+11
-21
lines changed

labelbox/schema/project.py

Lines changed: 11 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -177,18 +177,15 @@ def export_labels(self, timeout_seconds=60):
177177
self.uid)
178178
time.sleep(sleep_time)
179179

180-
def export_issues(self, status=None, timeout_seconds=60):
181-
""" Calls the server-side Issues exporting that generates a JSON
182-
payload, and returns the URL to that payload.
180+
def export_issues(self, status=None):
181+
""" Calls the server-side Issues exporting that
182+
returns the URL to that payload.
183183
184184
Args:
185-
timeout_seconds (float): Max waiting time, in seconds.
186185
status (string): valid values: Open, Resolved
187186
Returns:
188-
URL of the data file with this Project's issues. If the server didn't
189-
generate during the `timeout_seconds` period, None is returned.
187+
URL of the data file with this Project's issues.
190188
"""
191-
sleep_time = 2
192189
id_param = "projectId"
193190
status_param = "status"
194191
query_str = """query GetProjectIssuesExportPyApi($%s: ID!, $%s: IssueStatus) {
@@ -203,23 +200,16 @@ def export_issues(self, status=None, timeout_seconds=60):
203200
raise ValueError("status must be in {}. Found {}".format(
204201
valid_statuses, status))
205202

206-
while True:
207-
res = self.client.execute(query_str, {
208-
id_param: self.uid,
209-
status_param: status
210-
})
211-
res = res['project']
203+
res = self.client.execute(query_str, {
204+
id_param: self.uid,
205+
status_param: status
206+
})
212207

213-
if res.get('issueExportUrl') and res.get('issueExportUrl') != '':
214-
return res['issueExportUrl']
208+
res = res['project']
215209

216-
timeout_seconds -= sleep_time
217-
if timeout_seconds <= 0:
218-
return None
210+
logger.debug("Project '%s' issues export, link generated", self.uid)
219211

220-
logger.debug("Project '%s' issues export, waiting for server...",
221-
self.uid)
222-
time.sleep(sleep_time)
212+
return res.get('issueExportUrl')
223213

224214
def upsert_instructions(self, instructions_file: str):
225215
"""

0 commit comments

Comments
 (0)