From d3566d0aa8a69e84ed1f4edf30406da8314e373d Mon Sep 17 00:00:00 2001 From: Kirill Solomko Date: Fri, 25 Jun 2021 17:04:46 +0200 Subject: [PATCH] TT#127805 remove temp transcoded files * temp files created for transcoding operations are now correctly removed Change-Id: Ie95fccd2ed2a533060e4abc2fa3593c9f951225a --- lib/NGCP/Panel/Role/API/SoundFiles.pm | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/NGCP/Panel/Role/API/SoundFiles.pm b/lib/NGCP/Panel/Role/API/SoundFiles.pm index 48bb381fac..6af87a0a33 100644 --- a/lib/NGCP/Panel/Role/API/SoundFiles.pm +++ b/lib/NGCP/Panel/Role/API/SoundFiles.pm @@ -24,7 +24,9 @@ sub transcode_data { $resource->{data} = NGCP::Panel::Utils::Sounds::transcode_file( $filename, uc($from_codec), $resource->{codec}, ); + unlink($filename); } catch($e) { + unlink($filename); $c->log->error("failed to transcode file: $e"); $self->error($c, HTTP_UNPROCESSABLE_ENTITY, "Failed to transcode file"); return;