Fossil SCM
Take advantage of the fact that the seqno is recorded and automatically resume up to three times if failure is encountered.
Commit
bc0a4c60c00ddf67d952256ca4f2fb32911b235f8decb4d2a1242353a03fb23e
Parent
2f0aac8c01a393c…
1 file changed
+5
-1
+5
-1
| --- src/clone.c | ||
| +++ src/clone.c | ||
| @@ -144,10 +144,11 @@ | ||
| 144 | 144 | void clone_cmd(void){ |
| 145 | 145 | char *zPassword; |
| 146 | 146 | const char *zDefaultUser; /* Optional name of the default user */ |
| 147 | 147 | const char *zHttpAuth; /* HTTP Authorization user:pass information */ |
| 148 | 148 | int nErr = 0; |
| 149 | + int nResumes = 0; | |
| 149 | 150 | int urlFlags = URL_PROMPT_PW | URL_REMEMBER; |
| 150 | 151 | int syncFlags = SYNC_CLONE; |
| 151 | 152 | int noCompress = find_option("nocompress",0,0)!=0; |
| 152 | 153 | int noOpen = find_option("no-open",0,0)!=0; |
| 153 | 154 | int allowNested = find_option("nested",0,0)!=0; /* Used by open */ |
| @@ -281,11 +282,14 @@ | ||
| 281 | 282 | db_protect_pop(); |
| 282 | 283 | url_enable_proxy(0); |
| 283 | 284 | clone_ssh_db_set_options(); |
| 284 | 285 | url_get_password_if_needed(); |
| 285 | 286 | g.xlinkClusterOnly = 1; |
| 286 | - nErr = client_sync(syncFlags,CONFIGSET_ALL,0,0); | |
| 287 | + while( nResumes++<3 && (nErr = client_sync(syncFlags,CONFIGSET_ALL,0,0)) ){ | |
| 288 | + fossil_warning("cloning encountered errors, trying again."); | |
| 289 | + sqlite3_sleep(500); | |
| 290 | + } | |
| 287 | 291 | g.xlinkClusterOnly = 0; |
| 288 | 292 | verify_cancel(); |
| 289 | 293 | if( nErr ){ |
| 290 | 294 | fossil_warning("server returned an error - clone incomplete"); |
| 291 | 295 | }else{ |
| 292 | 296 |
| --- src/clone.c | |
| +++ src/clone.c | |
| @@ -144,10 +144,11 @@ | |
| 144 | void clone_cmd(void){ |
| 145 | char *zPassword; |
| 146 | const char *zDefaultUser; /* Optional name of the default user */ |
| 147 | const char *zHttpAuth; /* HTTP Authorization user:pass information */ |
| 148 | int nErr = 0; |
| 149 | int urlFlags = URL_PROMPT_PW | URL_REMEMBER; |
| 150 | int syncFlags = SYNC_CLONE; |
| 151 | int noCompress = find_option("nocompress",0,0)!=0; |
| 152 | int noOpen = find_option("no-open",0,0)!=0; |
| 153 | int allowNested = find_option("nested",0,0)!=0; /* Used by open */ |
| @@ -281,11 +282,14 @@ | |
| 281 | db_protect_pop(); |
| 282 | url_enable_proxy(0); |
| 283 | clone_ssh_db_set_options(); |
| 284 | url_get_password_if_needed(); |
| 285 | g.xlinkClusterOnly = 1; |
| 286 | nErr = client_sync(syncFlags,CONFIGSET_ALL,0,0); |
| 287 | g.xlinkClusterOnly = 0; |
| 288 | verify_cancel(); |
| 289 | if( nErr ){ |
| 290 | fossil_warning("server returned an error - clone incomplete"); |
| 291 | }else{ |
| 292 |
| --- src/clone.c | |
| +++ src/clone.c | |
| @@ -144,10 +144,11 @@ | |
| 144 | void clone_cmd(void){ |
| 145 | char *zPassword; |
| 146 | const char *zDefaultUser; /* Optional name of the default user */ |
| 147 | const char *zHttpAuth; /* HTTP Authorization user:pass information */ |
| 148 | int nErr = 0; |
| 149 | int nResumes = 0; |
| 150 | int urlFlags = URL_PROMPT_PW | URL_REMEMBER; |
| 151 | int syncFlags = SYNC_CLONE; |
| 152 | int noCompress = find_option("nocompress",0,0)!=0; |
| 153 | int noOpen = find_option("no-open",0,0)!=0; |
| 154 | int allowNested = find_option("nested",0,0)!=0; /* Used by open */ |
| @@ -281,11 +282,14 @@ | |
| 282 | db_protect_pop(); |
| 283 | url_enable_proxy(0); |
| 284 | clone_ssh_db_set_options(); |
| 285 | url_get_password_if_needed(); |
| 286 | g.xlinkClusterOnly = 1; |
| 287 | while( nResumes++<3 && (nErr = client_sync(syncFlags,CONFIGSET_ALL,0,0)) ){ |
| 288 | fossil_warning("cloning encountered errors, trying again."); |
| 289 | sqlite3_sleep(500); |
| 290 | } |
| 291 | g.xlinkClusterOnly = 0; |
| 292 | verify_cancel(); |
| 293 | if( nErr ){ |
| 294 | fossil_warning("server returned an error - clone incomplete"); |
| 295 | }else{ |
| 296 |