Tmp file db.csv now deleted after sucess/fail uploading
MODIFY
BT-Tracking/Interface/Data List/DataListVC.swift
BT-Tracking/Interface/Data List/DataListVC.swift
@@ -160,6 +160,7 @@ final class DataListVC: UIViewController, UITableViewDelegate {
guard let self = self else { return }
self.activityView.isHidden = true
+ self.writer?.deleteFile()
if let error = error {
log("FirebaseUpload: Error \(error.localizedDescription)")

MODIFY
BT-Tracking/Services/CSV/CSVWriter.swift
BT-Tracking/Services/CSV/CSVWriter.swift
@@ -18,7 +18,7 @@ protocol CSVMakering {
var fromDate: Date? { get }
func createFile(callback: @escaping Callback)
-
+ func deleteFile()
}
/*
@@ -80,4 +80,11 @@ final class CSVMaker: CSVMakering {
callback(Result(fileURL, metadata), nil)
}
+ func deleteFile() {
+ do {
+ try FileManager.default.removeItem(at: fileURL)
+ } catch let error as NSError {
+ print("Could not clear temp file CSVMaker: \(error)")
+ }
+ }
}

Tmp file db.csv now deleted after sucess/fail uploading