Пример #1
0
        private int AvailableSynchronizationRequestsTo(string destinationFileSystemUrl)
        {
            var max    = SynchronizationConfigAccessor.GetOrDefault(storage).MaxNumberOfSynchronizationsPerDestination;
            var active = synchronizationQueue.NumberOfActiveSynchronizationsFor(destinationFileSystemUrl);

            return(max - active);
        }
Пример #2
0
        private int AvailableSynchronizationRequestsTo(string destinationFileSystemUrl)
        {
            if (destinationFileSystemUrl == null)
            {
                Debugger.Launch();
                Debugger.Break();
            }

            return(SynchronizationConfigAccessor.GetOrDefault(storage).MaxNumberOfSynchronizationsPerDestination - synchronizationQueue.NumberOfActiveSynchronizationTasksFor(destinationFileSystemUrl));
        }
Пример #3
0
        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);
        }
Пример #4
0
 private bool CanSynchronizeTo(string destinationFileSystemUrl)
 {
     return(SynchronizationConfigAccessor.GetOrDefault(storage).MaxNumberOfSynchronizationsPerDestination > synchronizationQueue.NumberOfActiveSynchronizationTasksFor(destinationFileSystemUrl));
 }