add loginfo on the toCsv()

This commit is contained in:
atef 2023-10-03 16:00:28 +02:00
parent 1fb95cbb56
commit ea5ce5617a
1 changed files with 4 additions and 1 deletions

View File

@ -316,14 +316,17 @@ internal static class Program
private static async Task<Boolean> UploadCsv(StatusRecord status, DateTime timeStamp)
{
var s3Config = status.Config.S3;
var csv = status.ToCsv().LogInfo();
if (s3Config is null)
return false;
var csv = status.ToCsv();
var s3Path = timeStamp + ".csv";
var request = s3Config.CreatePutRequest(s3Path);
var response = await request.PutAsync(new StringContent(csv));
// This is temporary for Wittman
//await File.WriteAllTextAsync("/var/www/html/status.csv", csv.SplitLines().Where(l => !l.Contains("Secret")).JoinLines());
if (response.StatusCode != 200)
{
Console.WriteLine("ERROR: PUT");