Skip to content
This repository was archived by the owner on Mar 21, 2023. It is now read-only.

Commit 0f8ef24

Browse files
committed
v1.4.3
### Configuration Manager - Updated Assembly Version/FileVersion ### Service - Updated Assembly Version/FileVersion - **Enhancement**: Removed Stop(); from each failure catch to prevent random service stops - **Enhancement**: Added TryCatch to each part of the exporter to the export doesn't fail entirely - **Enhancement**: Added in SetLastAggregateRegistry() and GetLastAggregateRegistry() to track exports to hopefully prevent duplicates ### Core - Updated Assembly Version/FileVersion - **Bug**: Reverted bug that was introduced in v1.4.2 trying to fix [#14] - **Enhancement**: Added SendFailureAlert() to mailer.cs
1 parent 32818a0 commit 0f8ef24

File tree

10 files changed

+586
-158
lines changed

10 files changed

+586
-158
lines changed
1.25 KB
Binary file not shown.
35.1 KB
Binary file not shown.
5.51 KB
Loading

SnowMorningCheck.Configurator/Properties/AssemblyInfo.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,5 +32,5 @@
3232
// You can specify all the values or you can default the Build and Revision Numbers
3333
// by using the '*' as shown below:
3434
// [assembly: AssemblyVersion("1.0.*")]
35-
[assembly: AssemblyVersion("1.4.2")]
36-
[assembly: AssemblyFileVersion("1.4.2")]
35+
[assembly: AssemblyVersion("1.4.3")]
36+
[assembly: AssemblyFileVersion("1.4.3")]

SnowMorningCheck.Core/Classes/Mailer.cs

Lines changed: 31 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -94,8 +94,33 @@ public void SendEmail(string attachment, string version)
9494
File.Delete(attachment);
9595
}
9696

97+
public void SendFailureAlert(string alertBody)
98+
{
99+
user = Utilities.ReadXMLValue(dc.Config + ac.SMTPConfig, "Username");
100+
pass = Utilities.Decrypt(Utilities.ReadXMLValue(dc.Config + ac.SMTPConfig, "Password"));
101+
port = Utilities.ReadXMLValue(dc.Config + ac.SMTPConfig, "Port");
102+
sslEnabled = Convert.ToBoolean(Utilities.ReadXMLValue(dc.Config + ac.SMTPConfig, "SSLEnabled"));
103+
host = Utilities.ReadXMLValue(dc.Config + ac.SMTPConfig, "Host");
104+
sender = Utilities.ReadXMLValue(dc.Config + ac.SMTPConfig, "Sender");
105+
if (Utilities.ReadXMLValue(dc.Config + ac.SMTPConfig, "SenderName").Length < 1)
106+
{
107+
displayname = sender;
108+
}
109+
else
110+
{
111+
displayname = Utilities.ReadXMLValue(dc.Config + ac.SMTPConfig, "SenderName");
112+
}
113+
to = Utilities.ReadXMLValue(dc.Config + ac.SMTPConfig, "SendTo");
114+
cc = Utilities.ReadXMLValue(dc.Config + ac.SMTPConfig, "CC");
115+
subject = "Export Failure" + Utilities.ReadXMLValue(dc.Config + ac.SMTPConfig, "Subject");
116+
117+
body = alertBody;
97118

98-
internal void Emailer(string filePath, string emailSubject = "Report - Snow Platform Monitor")
119+
Emailer(subject);
120+
}
121+
122+
123+
internal void Emailer(string filePath = null, string emailSubject = "Report - Snow Platform Monitor")
99124
{
100125
MailMessage mail = new MailMessage
101126
{
@@ -113,9 +138,12 @@ internal void Emailer(string filePath, string emailSubject = "Report - Snow Plat
113138
EnableSsl = sslEnabled
114139
};
115140

116-
Attachment att = new Attachment(filePath);
141+
if(filePath != null)
142+
{
143+
Attachment att = new Attachment(filePath);
144+
mail.Attachments.Add(att);
145+
}
117146

118-
mail.Attachments.Add(att);
119147
mail.To.Add(to);
120148

121149
if (cc.Length > 0)

SnowMorningCheck.Core/Classes/SnowLogs.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
using System.Collections.Generic;
33
using System.Data;
44
using System.IO;
5-
using System.Linq;
65

76
namespace SnowPlatformMonitor.Core.Classes
87
{
@@ -28,7 +27,7 @@ internal static string GetNewestLog(string directory)
2827
return "";
2928

3029
FileInfo[] files = directoryInfo.GetFiles();
31-
DateTime recentWrite = DateTime.Now.AddDays(-1);
30+
DateTime recentWrite = DateTime.MinValue;
3231
FileInfo recentFile = null;
3332

3433
foreach (FileInfo file in files)

SnowMorningCheck.Core/Properties/AssemblyInfo.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,5 +32,5 @@
3232
// You can specify all the values or you can default the Build and Revision Numbers
3333
// by using the '*' as shown below:
3434
// [assembly: AssemblyVersion("1.0.*")]
35-
[assembly: AssemblyVersion("1.4.2")]
36-
[assembly: AssemblyFileVersion("1.4.2")]
35+
[assembly: AssemblyVersion("1.4.3")]
36+
[assembly: AssemblyFileVersion("1.4.3")]

0 commit comments

Comments
 (0)