diff options
author | Colin Cross <ccross@android.com> | 2015-05-13 00:10:02 -0700 |
---|---|---|
committer | Colin Cross <ccross@android.com> | 2015-05-13 18:11:34 +0000 |
commit | c4b301f988ad7499257538070f78f5e50e61b3ae (patch) | |
tree | f19c83f4c06684361ffb2fec3028b34f89211a29 /project.py | |
parent | 31a7be561ef34c134447d92a3d391b17ecd7c790 (diff) | |
download | git-repo-c4b301f988ad7499257538070f78f5e50e61b3ae.tar.gz |
Skip sleep and retry if git remote update exits with a signal
Pressing ctrl-c during repo sync often hangs for 30 to 45 seconds
due to the time.sleep and retry in _RemoteFetch. If git exits with
a signal, for example -2 for SIGINT triggered by ctrl-c, skip the
sleep and retry.
Change-Id: I32da12c2dcc96d9cc0b12a066e824b12ebfb52a0
Diffstat (limited to 'project.py')
-rw-r--r-- | project.py | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -1908,6 +1908,9 @@ class Project(object): | |||
1908 | # mode, we just tried sync'ing from the upstream field; it doesn't exist, thus | 1908 | # mode, we just tried sync'ing from the upstream field; it doesn't exist, thus |
1909 | # abort the optimization attempt and do a full sync. | 1909 | # abort the optimization attempt and do a full sync. |
1910 | break | 1910 | break |
1911 | elif ret < 0: | ||
1912 | # Git died with a signal, exit immediately | ||
1913 | break | ||
1911 | time.sleep(random.randint(30, 45)) | 1914 | time.sleep(random.randint(30, 45)) |
1912 | 1915 | ||
1913 | if initial: | 1916 | if initial: |