Skip to content

Commit de0c8d2

Browse files
jeffhostetlerdscho
authored andcommitted
gvfs-helper: add --max-retries to prefetch verb
Signed-off-by: Jeff Hostetler <[email protected]>
1 parent 23bc195 commit de0c8d2

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

‎gvfs-helper.c‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,11 @@
105105
// The GVFS Protocol defines this value as a way to
106106
// request cached packfiles NEWER THAN this timestamp.
107107
//
108+
// --max-retries=<n> // defaults to "6"
109+
//
110+
// Number of retries after transient network errors.
111+
// Set to zero to disable such retries.
112+
//
108113
// server
109114
//
110115
// Interactive/sub-process mode. Listen for a series of commands
@@ -3786,6 +3791,8 @@ static enum gh__error_code do_sub_cmd__prefetch(int argc, const char **argv)
37863791
static const char *since_str;
37873792
static struct option prefetch_options[] = {
37883793
OPT_STRING(0, "since", &since_str, N_("since"), N_("seconds since epoch")),
3794+
OPT_INTEGER('r', "max-retries", &gh__cmd_opts.max_retries,
3795+
N_("retries for transient network errors")),
37893796
OPT_END(),
37903797
};
37913798

@@ -3805,6 +3812,8 @@ static enum gh__error_code do_sub_cmd__prefetch(int argc, const char **argv)
38053812
if (my_parse_since(since_str, &seconds_since_epoch))
38063813
die("could not parse 'since' field");
38073814
}
3815+
if (gh__cmd_opts.max_retries < 0)
3816+
gh__cmd_opts.max_retries = 0;
38083817

38093818
finish_init(1);
38103819

0 commit comments

Comments
 (0)