refactor: remove portfolio file after encrypting

This commit is contained in:
Sebastian Pravda 2023-01-21 23:28:35 +01:00
parent dd456a7870
commit 205996cc2e
No known key found for this signature in database
GPG key ID: F3BC84F08EFA3F57

View file

@ -394,13 +394,14 @@ impl PortfolioService {
&private_key
).await?;
tokio::fs::remove_file(path.to_owned()).await?;
let enc_portfolio= crypto::encrypt_buffer_with_recipients(
&plain_portfolio,
recipients
).await?;
tokio::fs::remove_file(path.to_owned()).await?;
tokio::fs::write(path, enc_portfolio).await?;
info!("PORTFOLIO {} REENCRYPT FINISHED", candidate_id);