Fossil SCM

Only sleep if there are more sync attempts to be made.

andybradford 2014-06-13 06:11 trunk
Commit e1dccc177250a2e55e1d89b7f60b93004f7b2b70
1 file changed +2 -2
+2 -2
--- src/sync.c
+++ src/sync.c
@@ -82,14 +82,14 @@
8282
** .5 second sleep between attempts; returning the last autosync status.
8383
*/
8484
int autosync_loop(int flags, int nTries){
8585
int n = 0;
8686
int rc = 0;
87
- while( (n==0 || n < nTries) && (rc = autosync(flags) )){
87
+ while( (n==0 || n < nTries) && (rc = autosync(flags)) ){
8888
if( rc ) fossil_warning("Autosync failed%s",
8989
++n < nTries ? ", making another attempt." : ".");
90
- sqlite3_sleep(500);
90
+ if( n < nTries ) sqlite3_sleep(500);
9191
}
9292
return rc;
9393
}
9494
9595
/*
9696
--- src/sync.c
+++ src/sync.c
@@ -82,14 +82,14 @@
82 ** .5 second sleep between attempts; returning the last autosync status.
83 */
84 int autosync_loop(int flags, int nTries){
85 int n = 0;
86 int rc = 0;
87 while( (n==0 || n < nTries) && (rc = autosync(flags) )){
88 if( rc ) fossil_warning("Autosync failed%s",
89 ++n < nTries ? ", making another attempt." : ".");
90 sqlite3_sleep(500);
91 }
92 return rc;
93 }
94
95 /*
96
--- src/sync.c
+++ src/sync.c
@@ -82,14 +82,14 @@
82 ** .5 second sleep between attempts; returning the last autosync status.
83 */
84 int autosync_loop(int flags, int nTries){
85 int n = 0;
86 int rc = 0;
87 while( (n==0 || n < nTries) && (rc = autosync(flags)) ){
88 if( rc ) fossil_warning("Autosync failed%s",
89 ++n < nTries ? ", making another attempt." : ".");
90 if( n < nTries ) sqlite3_sleep(500);
91 }
92 return rc;
93 }
94
95 /*
96

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button