17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
|
17
18
19
20
21
22
23
24
25
26
27
28
29
30
|
-
-
-
-
-
-
-
|
**
** This file contains code used to push, pull, and sync a repository
*/
#include "config.h"
#include "sync.h"
#include <assert.h>
#if defined(_WIN32)
# include <windows.h> /* for Sleep */
# if defined(__MINGW32__) || defined(_MSC_VER)
# define sleep Sleep /* windows does not have sleep, but Sleep */
# endif
#endif
#define AUTOSYNC_TRIES 3
/*
** If the repository is configured for autosyncing, then do an
** autosync. This will be a pull if the argument is true or a push
** if the argument is false.
**
|
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
|
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
|
-
+
|
*/
int autosync_loop(int flags){
int n = 0;
int rc = 0;
while (n++ < AUTOSYNC_TRIES && (rc = autosync(flags))){
if( rc ) fossil_warning("Autosync failed%s",
n < AUTOSYNC_TRIES ? ", making another attempt." : ".");
sleep(1);
sqlite3_sleep(500);
}
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
|