Skip to content

Commit

Permalink
change tmp dir to see if github CI stops getting stuck here
Browse files Browse the repository at this point in the history
  • Loading branch information
garciampred committed Jan 9, 2025
1 parent 73d118c commit f7ad1ad
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion cdsobs/cli/_copy_dataset.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import os
from io import BytesIO
from pathlib import Path
from tempfile import NamedTemporaryFile
Expand Down Expand Up @@ -248,8 +249,9 @@ def copy_object(object_url):
name = object_url.split("/")[-1]
response = requests.get(object_url, stream=True)
response.raise_for_status()
tmp_base = "/tmp" if os.getenv("GITHUB_ACTIONS") else "/dev/shm"
with (
NamedTemporaryFile(dir="/dev/shm") as ntf,
NamedTemporaryFile(dir=tmp_base) as ntf,
BytesIO(response.content) as bc,
):
ntf.write(bc.read())
Expand Down

0 comments on commit f7ad1ad

Please sign in to comment.