Skip to content

Commit a70b4ff

Browse files
fix(LAB-3572): change query timeout and remove retry mechanism to copy_project (#1871)
1 parent cadac75 commit a70b4ff

File tree

3 files changed

+10
-2
lines changed

3 files changed

+10
-2
lines changed

src/kili/adapters/kili_api_gateway/project/operations_mixin.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,5 +120,7 @@ def copy_project(
120120
}
121121
}
122122

123-
result = self.graphql_client.execute(GQL_COPY_PROJECT, variables)
123+
# For the copy_project call, we want a much higher timeout, since it can take a long time for large projects.
124+
# Instead of 60 seconds, we pass to waiting for 10 minutes.
125+
result = self.graphql_client.execute(GQL_COPY_PROJECT, variables, retry=False, timeout=600)
124126
return ProjectId(result.get("data", ""))

src/kili/core/graphql/graphql_client.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -257,8 +257,12 @@ def execute(
257257
document = query if isinstance(query, DocumentNode) else gql(query)
258258
variables = self._remove_nullable_inputs(variables) if variables else None
259259

260+
should_retry = kwargs.pop("retry", True)
261+
260262
try:
261-
return self._execute_with_retries(document, variables, **kwargs)
263+
if should_retry:
264+
return self._execute_with_retries(document, variables, **kwargs)
265+
return self._raw_execute(document, variables, **kwargs)
262266

263267
except graphql.GraphQLError: # local validation error
264268
# the local schema might be outdated

src/kili/entrypoints/cli/project/copy.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,8 @@ def copy_project(
5252
5353
By default, only the json interface, quality settings and project members are copied.
5454
55+
By default, this method is not configured with a retry mechanism and its timeout is extended to 10 minutes.
56+
5557
If no `title` is provided, the source project title will be used.
5658
If no description is provided, the description will be set to an empty string.
5759

0 commit comments

Comments
 (0)