delete tars after use

This commit is contained in:
Niko Storni 2021-11-25 04:26:04 +01:00
parent 6e819b20f6
commit 75628d8530

View file

@ -143,7 +143,10 @@ func (s *Sync) downloadBlockchainDB() error {
if err != nil { if err != nil {
return errors.Prefix("error extracting blockchain.db files", err) return errors.Prefix("error extracting blockchain.db files", err)
} }
err = os.Remove(defaultTempBDBPath)
if err != nil {
return errors.Err(err)
}
log.Printf("blockchain.db data downloaded and extracted to %s", blockchainDbDir) log.Printf("blockchain.db data downloaded and extracted to %s", blockchainDbDir)
return nil return nil
} }
@ -264,5 +267,9 @@ func (s *Sync) uploadBlockchainDB() error {
return err return err
} }
log.Println("blockchain.db files uploaded to S3") log.Println("blockchain.db files uploaded to S3")
err = os.Remove(tarPath)
if err != nil {
return errors.Err(err)
}
return os.Remove(defaultBDBDir) return os.Remove(defaultBDBDir)
} }