Skip to content

Commit

Permalink
(dbt-labs#2195) DBT_HTTP_TIMEOUT environment variable added
Browse files Browse the repository at this point in the history
  • Loading branch information
Raalsky committed Mar 23, 2020
1 parent cce99b1 commit d6cb415
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion core/dbt/deps/registry.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ def _fetch_metadata(self, project, renderer) -> RegistryPackageMetadata:
return RegistryPackageMetadata.from_dict(dct)

def install(self, project, renderer):
connection_timeout = float(os.getenv('DBT_HTTP_TIMEOUT', 10))
metadata = self.fetch_metadata(project, renderer)

tar_name = '{}.{}.tar.gz'.format(self.package, self.version)
Expand All @@ -61,7 +62,7 @@ def install(self, project, renderer):
system.make_directory(os.path.dirname(tar_path))

download_url = metadata.downloads.tarball
system.download(download_url, tar_path, timeout=10)
system.download(download_url, tar_path, timeout=connection_timeout)
deps_path = project.modules_path
package_name = self.get_project_name(project, renderer)
system.untar_package(tar_path, deps_path, package_name)
Expand Down

0 comments on commit d6cb415

Please sign in to comment.