Skip to content

Commit

Permalink
Don't infer file size right away
Browse files Browse the repository at this point in the history
Importing the first 10 studies on IDC has been taking around 20 minutes.
About 65% of that time has been spent on inferring file sizes.

Even though we don't stream the file data, the request from which we get
the content length must be taking some time on the server. Skip doing
this for now. We can add it back in if we figure out a way to make it much
faster.

Signed-off-by: Patrick Avery <[email protected]>
  • Loading branch information
psavery committed Feb 6, 2024
1 parent 8713390 commit f0e3617
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -503,8 +503,9 @@ def importData(self, parent, parentType, params, progress, user, **kwargs):
}
file['imported'] = True

# Try to infer the file size without streaming, if possible.
file['size'] = self._infer_file_size(file)
# Inferring the file size can take a long time, so don't
# do it right away, unless we figure out a way to make it faster.
# file['size'] = self._infer_file_size(file)
file = File().save(file)

items.append(item)
Expand Down

0 comments on commit f0e3617

Please sign in to comment.