diff options
author | Paul Sherwood <paul.sherwood@codethink.co.uk> | 2015-09-12 22:40:08 +0000 |
---|---|---|
committer | Paul Sherwood <paul.sherwood@codethink.co.uk> | 2015-09-12 22:40:08 +0000 |
commit | 4d8f6d473b459970dead66d506a97fd66656dfb0 (patch) | |
tree | 4060318bd2e6b703f70454dab857721203065668 | |
parent | e925efa9bfffe0e61a7dce35fa9a0b9329ba65aa (diff) | |
download | ybd-make-git-clones-atomic.tar.gz |
Allow parallel gitdir attemptsmake-git-clones-atomic
-rw-r--r-- | repos.py | 7 |
1 files changed, 3 insertions, 4 deletions
@@ -26,6 +26,7 @@ import requests import app import utils +import tempfile if sys.version_info.major == 2: @@ -107,10 +108,8 @@ def get_tree(this): def mirror(name, repo): - gitdir = os.path.join(app.config['gits'], get_repo_name(repo)) - tmpdir = gitdir + '.tmp' - if os.path.isdir(tmpdir): - shutil.rmtree(tmpdir) + tempfile.tempdir = app.config['tmp'] + tmpdir = tempfile.mkdtemp() repo_url = get_repo_url(repo) try: os.makedirs(tmpdir) |