On Fri, Sep 02, 2022 at 09:50:06PM +0000, Job Snijders wrote:
> Hi Claudio,
>
> This looks mostly OK, just a few nit:
>
> On Fri, Sep 02, 2022 at 10:02:33PM +0200, Claudio Jeker wrote:
> > @@ -1223,8 +1224,26 @@ repo_check_timeout(int timeout)
> > {
> > struct repo *rp;
> > time_t now;
> > + int diff;
> >
> > now = getmonotime();
> > +
> > + /* check against our runtime deadline first */
> > + if (deadline != 0) {
> > + if (deadline <= now) {
> > + warnx("deadline reached, giving up on repository sync");
>
> It might be better to avoid executing this code path when 'noop' (-n) is
> enabled?
>
I change main.c to do this instead:
+ /* give up a bit before the hard timeout and try to finish up */
+ if (!noop)
+ deadline = getmonotime() + timeout - repo_timeout / 2;
This should do the same because deadlines remains 0 in noop mode.
> Other than that - OK
>
> Kind regards,
>
> Job
>
--
:wq Claudio