Commit e6509072 authored by Charles Still's avatar Charles Still
Browse files

Fix backup poll in file pollforecast instead of program.cs

parent 8aa56ab0
...@@ -24,6 +24,7 @@ namespace BeeWeatherPollenTracker ...@@ -24,6 +24,7 @@ namespace BeeWeatherPollenTracker
private List<string> _poll_type = new List<string>(); private List<string> _poll_type = new List<string>();
private List<beehive_poll_forecast> _poll_forecast_list; private List<beehive_poll_forecast> _poll_forecast_list;
private static LoggerManager logs = null; private static LoggerManager logs = null;
private string pollenJson = "";
#endregion #endregion
/// <summary> /// <summary>
...@@ -50,6 +51,7 @@ namespace BeeWeatherPollenTracker ...@@ -50,6 +51,7 @@ namespace BeeWeatherPollenTracker
catch (Exception ex) catch (Exception ex)
{ {
logs.WriteInFile(ex); logs.WriteInFile(ex);
logs.WriteBackup(LoggerManager.DataForcastType.POLL, pollenJson);
} }
finally finally
{ {
...@@ -79,7 +81,7 @@ namespace BeeWeatherPollenTracker ...@@ -79,7 +81,7 @@ namespace BeeWeatherPollenTracker
{ {
var pollenResults = pollenClient.GetAsync(POLLEN_FORECAST_URL).Result; var pollenResults = pollenClient.GetAsync(POLLEN_FORECAST_URL).Result;
var pollenJson = pollenResults.Content.ReadAsStringAsync().Result; pollenJson = pollenResults.Content.ReadAsStringAsync().Result;
pollenData = JsonConvert.DeserializeObject<ClimateEnvironment>(pollenJson); pollenData = JsonConvert.DeserializeObject<ClimateEnvironment>(pollenJson);
} }
......
...@@ -47,12 +47,7 @@ namespace BeeWeatherPollenTracker ...@@ -47,12 +47,7 @@ namespace BeeWeatherPollenTracker
catch (Exception e) catch (Exception e)
{ {
logs.WriteInFile(e); logs.WriteInFile(e);
logs.WriteBackup(LoggerManager.DataForcastType.POLL, pollenJson);
} }
#endregion Pollen
t.Join();
} }
} }
} }
\ No newline at end of file
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment