PVF: fix unshare "could not create temporary directory"; refactor (#2663)

Co-authored-by: Alexandru Vasile <60601340+lexnv@users.noreply.github.com>
This commit is contained in:
Marcin S
2023-12-13 21:38:27 +01:00
committed by GitHub
parent 30151bd357
commit c5cf395963
4 changed files with 78 additions and 65 deletions
+3 -2
View File
@@ -217,6 +217,9 @@ pub async fn start(
) -> SubsystemResult<(ValidationHost, impl Future<Output = ()>)> {
gum::debug!(target: LOG_TARGET, ?config, "starting PVF validation host");
// Make sure the cache is initialized before doing anything else.
let artifacts = Artifacts::new_and_prune(&config.cache_path).await;
// Run checks for supported security features once per host startup. If some checks fail, warn
// if Secure Validator Mode is disabled and return an error otherwise.
let security_status = match security::check_security_status(&config).await {
@@ -260,8 +263,6 @@ pub async fn start(
let run_sweeper = sweeper_task(to_sweeper_rx);
let run_host = async move {
let artifacts = Artifacts::new_and_prune(&config.cache_path).await;
run(Inner {
cleanup_pulse_interval: Duration::from_secs(3600),
artifact_ttl: Duration::from_secs(3600 * 24),