Skip to content

Commit

Permalink
gvfs-helper: add --max-retries to prefetch verb
Browse files Browse the repository at this point in the history
Signed-off-by: Jeff Hostetler <jeffhostetler@github.com>
  • Loading branch information
jeffhostetler authored and dscho committed Sep 18, 2024
1 parent 653d77d commit 1761a30
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions gvfs-helper.c
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,11 @@
// The GVFS Protocol defines this value as a way to
// request cached packfiles NEWER THAN this timestamp.
//
// --max-retries=<n> // defaults to "6"
//
// Number of retries after transient network errors.
// Set to zero to disable such retries.
//
// server
//
// Interactive/sub-process mode. Listen for a series of commands
Expand Down Expand Up @@ -3753,6 +3758,8 @@ static enum gh__error_code do_sub_cmd__prefetch(int argc, const char **argv)
static const char *since_str;
static struct option prefetch_options[] = {
OPT_STRING(0, "since", &since_str, N_("since"), N_("seconds since epoch")),
OPT_INTEGER('r', "max-retries", &gh__cmd_opts.max_retries,
N_("retries for transient network errors")),
OPT_END(),
};

Expand All @@ -3772,6 +3779,8 @@ static enum gh__error_code do_sub_cmd__prefetch(int argc, const char **argv)
if (my_parse_since(since_str, &seconds_since_epoch))
die("could not parse 'since' field");
}
if (gh__cmd_opts.max_retries < 0)
gh__cmd_opts.max_retries = 0;

finish_init(1);

Expand Down

0 comments on commit 1761a30

Please sign in to comment.