perf: optimize backend — HTTP client, DB queries, error handling, and config cleanup
Some checks failed
CI / lint-and-build (push) Failing after 2m55s
Some checks failed
CI / lint-and-build (push) Failing after 2m55s
This commit is contained in:
@@ -13,7 +13,7 @@ pub async fn export_csv(
|
||||
let mut wtr = csv::Writer::from_writer(file);
|
||||
|
||||
wtr.write_record(&columns)
|
||||
.map_err(|e| TuskError::Custom(e.to_string()))?;
|
||||
.map_err(|e| TuskError::Export(e.to_string()))?;
|
||||
|
||||
for row in &rows {
|
||||
let record: Vec<String> = row
|
||||
@@ -27,10 +27,10 @@ pub async fn export_csv(
|
||||
})
|
||||
.collect();
|
||||
wtr.write_record(&record)
|
||||
.map_err(|e| TuskError::Custom(e.to_string()))?;
|
||||
.map_err(|e| TuskError::Export(e.to_string()))?;
|
||||
}
|
||||
|
||||
wtr.flush().map_err(|e| TuskError::Custom(e.to_string()))?;
|
||||
wtr.flush().map_err(|e| TuskError::Export(e.to_string()))?;
|
||||
Ok(())
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user