AngularAzureSearch.WebAPI.PartitionResolvers.SpilloverPartitionResolver.ShouldCreateCollection C# (CSharp) Метод

ShouldCreateCollection() приватный Метод

Check if a spillover has to be scheduled.
private ShouldCreateCollection ( ) : bool
Результат bool
        private bool ShouldCreateCollection()
        {
            if (this.CollectionLinks.Count == 0)
            {
                return true;
            }

            string lastCollectionLink = this.CollectionLinks.Last();
            if (this.LastCheckTimeUtc == null || DateTime.UtcNow >= this.LastCheckTimeUtc.Add(this.CheckInterval))
            {
                ResourceResponse<DocumentCollection> response = this.Client.ReadDocumentCollectionAsync(lastCollectionLink).Result;
                this.LastCheckTimeUtc = DateTime.UtcNow;
                if (response.CollectionSizeUsage >= response.CollectionSizeQuota * this.FillFactor)
                {
                    return true;
                }
            }

            return false;
        }