1
0
mirror of https://github.com/bitwarden/directory-connector synced 2025-12-11 13:53:22 +00:00

constant program name. copyright info. stopwatch

This commit is contained in:
Kyle Spearrin
2017-05-17 10:55:48 -04:00
parent 8bf84682c1
commit d6085a3dea
5 changed files with 25 additions and 12 deletions

View File

@@ -22,7 +22,7 @@ namespace Service
public Service()
{
ServiceName = "bitwarden Directory Connector";
ServiceName = Constants.ProgramName;
_components = new Container();
@@ -99,15 +99,19 @@ namespace Service
{
try
{
var sw = Stopwatch.StartNew();
var result = Sync.SyncAllAsync(false, true).GetAwaiter().GetResult();
sw.Stop();
if(result.Success)
{
_eventLog.WriteEntry($"Synced {result.Groups.Count} groups, {result.Users.Count} users.",
_eventLog.WriteEntry($"Synced {result.Groups.Count} groups, {result.Users.Count} users." +
$"The sync took {(int)sw.Elapsed.TotalSeconds} seconds to complete.",
EventLogEntryType.SuccessAudit);
}
else
{
_eventLog.WriteEntry($"Sync failed: {result.ErrorMessage}", EventLogEntryType.FailureAudit);
_eventLog.WriteEntry($"Sync failed after {(int)sw.Elapsed.TotalSeconds} seconds: {result.ErrorMessage}.",
EventLogEntryType.FailureAudit);
}
}
catch(ApplicationException e)