Fossil SCM

Use sqlite3_sleep() instead with a shorter wait.

andybradford 2014-04-24 14:21 autosync-tries
Commit 714f3ec3797d94c0ab97087a1b1acffe04df9c52
1 file changed +1 -8
+1 -8
--- src/sync.c
+++ src/sync.c
@@ -19,17 +19,10 @@
1919
*/
2020
#include "config.h"
2121
#include "sync.h"
2222
#include <assert.h>
2323
24
-#if defined(_WIN32)
25
-# include <windows.h> /* for Sleep */
26
-# if defined(__MINGW32__) || defined(_MSC_VER)
27
-# define sleep Sleep /* windows does not have sleep, but Sleep */
28
-# endif
29
-#endif
30
-
3124
#define AUTOSYNC_TRIES 3
3225
3326
/*
3427
** If the repository is configured for autosyncing, then do an
3528
** autosync. This will be a pull if the argument is true or a push
@@ -94,11 +87,11 @@
9487
int n = 0;
9588
int rc = 0;
9689
while (n++ < AUTOSYNC_TRIES && (rc = autosync(flags))){
9790
if( rc ) fossil_warning("Autosync failed%s",
9891
n < AUTOSYNC_TRIES ? ", making another attempt." : ".");
99
- sleep(1);
92
+ sqlite3_sleep(500);
10093
}
10194
return rc;
10295
}
10396
10497
/*
10598
--- src/sync.c
+++ src/sync.c
@@ -19,17 +19,10 @@
19 */
20 #include "config.h"
21 #include "sync.h"
22 #include <assert.h>
23
24 #if defined(_WIN32)
25 # include <windows.h> /* for Sleep */
26 # if defined(__MINGW32__) || defined(_MSC_VER)
27 # define sleep Sleep /* windows does not have sleep, but Sleep */
28 # endif
29 #endif
30
31 #define AUTOSYNC_TRIES 3
32
33 /*
34 ** If the repository is configured for autosyncing, then do an
35 ** autosync. This will be a pull if the argument is true or a push
@@ -94,11 +87,11 @@
94 int n = 0;
95 int rc = 0;
96 while (n++ < AUTOSYNC_TRIES && (rc = autosync(flags))){
97 if( rc ) fossil_warning("Autosync failed%s",
98 n < AUTOSYNC_TRIES ? ", making another attempt." : ".");
99 sleep(1);
100 }
101 return rc;
102 }
103
104 /*
105
--- src/sync.c
+++ src/sync.c
@@ -19,17 +19,10 @@
19 */
20 #include "config.h"
21 #include "sync.h"
22 #include <assert.h>
23
 
 
 
 
 
 
 
24 #define AUTOSYNC_TRIES 3
25
26 /*
27 ** If the repository is configured for autosyncing, then do an
28 ** autosync. This will be a pull if the argument is true or a push
@@ -94,11 +87,11 @@
87 int n = 0;
88 int rc = 0;
89 while (n++ < AUTOSYNC_TRIES && (rc = autosync(flags))){
90 if( rc ) fossil_warning("Autosync failed%s",
91 n < AUTOSYNC_TRIES ? ", making another attempt." : ".");
92 sqlite3_sleep(500);
93 }
94 return rc;
95 }
96
97 /*
98

Keyboard Shortcuts

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