private int AvailableSynchronizationRequestsTo(string destinationFileSystemUrl) { var max = SynchronizationConfigAccessor.GetOrDefault(storage).MaxNumberOfSynchronizationsPerDestination; var active = synchronizationQueue.NumberOfActiveSynchronizationsFor(destinationFileSystemUrl); return(max - active); }
private int AvailableSynchronizationRequestsTo(string destinationFileSystemUrl) { if (destinationFileSystemUrl == null) { Debugger.Launch(); Debugger.Break(); } return(SynchronizationConfigAccessor.GetOrDefault(storage).MaxNumberOfSynchronizationsPerDestination - synchronizationQueue.NumberOfActiveSynchronizationTasksFor(destinationFileSystemUrl)); }
public bool TimeoutExceeded(string fileName, IStorageActionsAccessor accessor) { SynchronizationLock syncLock; try { syncLock = accessor.GetConfig(RavenFileNameHelper.SyncLockNameForFile(fileName)).JsonDeserialization <SynchronizationLock>(); } catch (FileNotFoundException) { return(true); } return((DateTime.UtcNow - syncLock.FileLockedAt).TotalMilliseconds > SynchronizationConfigAccessor.GetOrDefault(accessor).SynchronizationLockTimeoutMiliseconds); }
private bool CanSynchronizeTo(string destinationFileSystemUrl) { return(SynchronizationConfigAccessor.GetOrDefault(storage).MaxNumberOfSynchronizationsPerDestination > synchronizationQueue.NumberOfActiveSynchronizationTasksFor(destinationFileSystemUrl)); }