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:
@@ -750,7 +750,8 @@ namespace Bit.Console
|
|||||||
}
|
}
|
||||||
|
|
||||||
Con.Write("Sync interval (minutes, minimum {1}) [{0}]: ", config.IntervalMinutes,
|
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();
|
input = Con.ReadLine();
|
||||||
int intervalMinutes;
|
int intervalMinutes;
|
||||||
if(!string.IsNullOrEmpty(input) && int.TryParse(input, out intervalMinutes))
|
if(!string.IsNullOrEmpty(input) && int.TryParse(input, out intervalMinutes))
|
||||||
|
|||||||
@@ -26,6 +26,9 @@ namespace Bit.Core.Models
|
|||||||
case DirectoryType.Other:
|
case DirectoryType.Other:
|
||||||
IntervalMinutes = 60;
|
IntervalMinutes = 60;
|
||||||
break;
|
break;
|
||||||
|
case DirectoryType.GSuite:
|
||||||
|
IntervalMinutes = 60;
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -76,13 +76,15 @@ namespace Service
|
|||||||
}
|
}
|
||||||
|
|
||||||
var intervalMinutes = SettingsService.Instance.Sync.IntervalMinutes;
|
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;
|
intervalMinutes = 60;
|
||||||
}
|
}
|
||||||
else if(intervalMinutes < 1)
|
else if(intervalMinutes < 5)
|
||||||
{
|
{
|
||||||
intervalMinutes = 1;
|
intervalMinutes = 5;
|
||||||
}
|
}
|
||||||
|
|
||||||
_eventLog.WriteEntry($"Starting timer with {intervalMinutes} minute interval.", EventLogEntryType.Information);
|
_eventLog.WriteEntry($"Starting timer with {intervalMinutes} minute interval.", EventLogEntryType.Information);
|
||||||
|
|||||||
Reference in New Issue
Block a user