75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
|
url_enable_proxy("via proxy: ");
rc = client_sync(flags, configSync, 0);
return rc;
}
/*
** This routine will try a number of times to perform autosync with a
** 0.5 second sleep between attempts; returning the last autosync status.
*/
int autosync_loop(int flags, int nTries){
int n = 0;
int rc = 0;
while( (n==0 || n<nTries) && (rc=autosync(flags)) ){
if( rc ){
if( ++n<nTries ){
fossil_warning("Autosync failed, making another attempt.");
sqlite3_sleep(500);
}else{
fossil_warning("Autosync failed.");
}
}
}
return rc;
}
/*
** This routine processes the command-line argument for push, pull,
** and sync. If a command-line argument is given, that is the URL
|
|
>
>
>
>
|
>
>
>
>
>
>
>
>
|
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
|
url_enable_proxy("via proxy: ");
rc = client_sync(flags, configSync, 0);
return rc;
}
/*
** This routine will try a number of times to perform autosync with a
** 0.5 second sleep between attempts.
**
** Return zero on success and non-zero on a failure. If failure occurs
** and doPrompt flag is true, ask the user if they want to continue, and
** if they answer "yes" then return zero in spite of the failure.
*/
int autosync_loop(int flags, int nTries, int doPrompt){
int n = 0;
int rc = 0;
while( (n==0 || n<nTries) && (rc=autosync(flags)) ){
if( rc ){
if( ++n<nTries ){
fossil_warning("Autosync failed, making another attempt.");
sqlite3_sleep(500);
}else{
fossil_warning("Autosync failed.");
}
}
}
if( rc && doPrompt ){
Blob ans;
char cReply;
prompt_user("continue in spite of sync failure (y/N)? ", &ans);
cReply = blob_str(&ans)[0];
if( cReply=='y' || cReply=='Y' ) rc = 0;
blob_reset(&ans);
}
return rc;
}
/*
** This routine processes the command-line argument for push, pull,
** and sync. If a command-line argument is given, that is the URL
|