mirror of
https://github.com/bitwarden/directory-connector
synced 2025-12-05 23:53:21 +00:00
adjust sync interval minimums
This commit is contained in:
@@ -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))
|
||||
|
||||
@@ -26,6 +26,9 @@ namespace Bit.Core.Models
|
||||
case DirectoryType.Other:
|
||||
IntervalMinutes = 60;
|
||||
break;
|
||||
case DirectoryType.GSuite:
|
||||
IntervalMinutes = 60;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user