Skip to content

Commit 551f95e

Browse files
committed
stop fetching from github on every import
1 parent d5edab6 commit 551f95e

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

sc_audit/backup/download.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,11 @@
1313

1414

1515
github = Github()
16-
data_repo = github.get_repo("stellarcarbon/sc-data")
16+
repo_name = "stellarcarbon/sc-data"
1717

1818

1919
def download_compatible_dumps() -> Path:
20+
data_repo = github.get_repo(repo_name)
2021
package_version = metadata.version("sc_audit")
2122
matching_refs = data_repo.get_git_matching_refs("tags/sc-audit")
2223
for ref_obj in matching_refs:
@@ -34,6 +35,7 @@ def download_dumps(ref: Opt[str] = NotSet) -> Path:
3435
Download DB table dump files from GitHub and return the tempdir where they are located.
3536
The caller of this function is responsible for deleting the tempdir after loading the files.
3637
"""
38+
data_repo = github.get_repo(repo_name)
3739
# note: the `get_contents` endpoint will fail for files >100 MB
3840
dump_cfiles = data_repo.get_contents("sc-audit", ref=ref)
3941
assert isinstance(dump_cfiles, list)

0 commit comments

Comments
 (0)