Closed khastation closed 3 years ago
Overall looks good if it is a sample only. For this change to be more “production ready”, I’d suggest to move the logger line to after deletion and include contactId with result of deletion as well.
File fileToDelete = new File(kvsStreamTrackObject.getSaveAudioFilePath().toString());
if (fileToDelete != null) {
Boolean deletionResult = fileToDelete.delete();
logger.info("Raw file for contactId {} deletion result: {}", contactId, deletionResult);
Overall looks good if it is a sample only. For this change to be more “production ready”, I’d suggest to move the logger line to after deletion and include contactId with result of deletion as well.
File fileToDelete = new File(kvsStreamTrackObject.getSaveAudioFilePath().toString()); if (fileToDelete != null) { Boolean deletionResult = fileToDelete.delete(); logger.info("Raw file for contactId {} deletion result: {}", contactId, deletionResult);
Thanks! I've made these changes now.
Issue #, if available:
Description of changes: This change adds code to clean up the /tmp folder in the KVSTranscribeStreamingLambda by removing raw audio files.
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.