1
0
mirror of https://github.com/bitwarden/directory-connector synced 2025-12-10 13:23:18 +00:00

adjust sync interval minimums

This commit is contained in:
Kyle Spearrin
2017-05-18 17:24:54 -04:00
parent 9ba0fecfb8
commit d76220e19a
3 changed files with 10 additions and 4 deletions

View File

@@ -750,7 +750,8 @@ namespace Bit.Console
}
Con.Write("Sync interval (minutes, minimum {1}) [{0}]: ", config.IntervalMinutes,
SettingsService.Instance.Server.Type == Core.Enums.DirectoryType.Other ? "30" : "1");
SettingsService.Instance.Server.Type == Core.Enums.DirectoryType.Other ||
SettingsService.Instance.Server.Type == Core.Enums.DirectoryType.GSuite ? "60" : "5");
input = Con.ReadLine();
int intervalMinutes;
if(!string.IsNullOrEmpty(input) && int.TryParse(input, out intervalMinutes))

View File

@@ -26,6 +26,9 @@ namespace Bit.Core.Models
case DirectoryType.Other:
IntervalMinutes = 60;
break;
case DirectoryType.GSuite:
IntervalMinutes = 60;
break;
default:
break;
}

View File

@@ -76,13 +76,15 @@ namespace Service
}
var intervalMinutes = SettingsService.Instance.Sync.IntervalMinutes;
if(SettingsService.Instance.Server.Type == Bit.Core.Enums.DirectoryType.Other && intervalMinutes < 60)
if((SettingsService.Instance.Server.Type == Bit.Core.Enums.DirectoryType.Other ||
SettingsService.Instance.Server.Type == Bit.Core.Enums.DirectoryType.GSuite)
&& intervalMinutes < 60)
{
intervalMinutes = 60;
}
else if(intervalMinutes < 1)
else if(intervalMinutes < 5)
{
intervalMinutes = 1;
intervalMinutes = 5;
}
_eventLog.WriteEntry($"Starting timer with {intervalMinutes} minute interval.", EventLogEntryType.Information);