Added ingest file cleanup

This commit is contained in:
Gregory Ballantine 2022-08-31 22:50:42 -04:00
parent 9010de6a14
commit 1548701ed3
2 changed files with 9 additions and 1 deletions

View File

@ -19,6 +19,6 @@ func main() {
// transcode file // transcode file
// TODO - t.Transcode(i.Name()) // TODO - t.Transcode(i.Name())
// clean up source file // clean up source file
// TODO - r.CleanupFile(i.Name()) r.CleanupFile(i.Name())
} }
} }

View File

@ -76,6 +76,14 @@ func (r *Repository) ArchiveFile(inFile string) {
} }
} }
func (r *Repository) CleanupFile(inFile string) {
// create ingest path
ingestPath := filepath.Join(r.basePath, "ingest", inFile)
// remove the file
os.Remove(ingestPath)
}
func create_repo_dir(path string) { func create_repo_dir(path string) {
_, err := os.Stat(path) _, err := os.Stat(path)
if os.IsNotExist(err) { if os.IsNotExist(err) {