Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Jenny Ryan
ouinet
Commits
1b2e0887
Commit
1b2e0887
authored
Apr 02, 2020
by
Peter Jankuliak
Browse files
Cancel injector&cache timeout if origin fails early
parent
6ad59687
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/client.cpp
View file @
1b2e0887
...
@@ -1263,7 +1263,22 @@ public:
...
@@ -1263,7 +1263,22 @@ public:
yield
.
log
(
"Starting job with timeout "
,
timeout
.
count
(),
"s"
);
yield
.
log
(
"Starting job with timeout "
,
timeout
.
count
(),
"s"
);
}
}
async_sleep
(
exec
,
n
*
chrono
::
seconds
(
3
),
cancel
,
yield
);
if
(
job_type
==
Type
::
injector_or_dcache
||
job_type
==
Type
::
proxy
)
{
// If origin is running, give it some time, but stop sleeping
// if origin fetch exits early.
if
(
!
secure_origin
.
is_running
())
return
;
Cancel
c
(
cancel
);
boost
::
optional
<
Job
::
Connection
>
jc
;
if
(
secure_origin
.
is_running
())
{
jc
=
secure_origin
.
on_finish_sig
([
&
c
]
{
c
();
});
}
async_sleep
(
exec
,
n
*
chrono
::
seconds
(
3
),
c
,
yield
);
}
else
{
async_sleep
(
exec
,
n
*
chrono
::
seconds
(
3
),
cancel
,
yield
);
}
}
}
};
};
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment