Fossil

Diff
Login

Diff

Differences From Artifact [7c0ba94b34]:

To Artifact [56f301d5f5]:


17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
**
** This file contains code used to push, pull, and sync a repository
*/
#include "config.h"
#include "sync.h"
#include <assert.h>

#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.
**
** Return the number of errors.
*/







<
<







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 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.
**
** Return the number of errors.
*/
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
  return rc;
}

/*
** This routine will try a number of times to perform autosync with a
** .5 second sleep between attempts; returning the last autosync status.
*/
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." : ".");
    sqlite3_sleep(500);
  }
  return rc;
}

/*
** This routine processes the command-line argument for push, pull,







|


|

|







77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
  return rc;
}

/*
** This routine will try a number of times to perform autosync with a
** .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 ) fossil_warning("Autosync failed%s",
      ++n < nTries ? ", making another attempt." : ".");
    sqlite3_sleep(500);
  }
  return rc;
}

/*
** This routine processes the command-line argument for push, pull,