Raven.Bundles.Quotas.SizeQuotaConfiguration.UpdateSkippedCheck C# (CSharp) Method

UpdateSkippedCheck() private method

private UpdateSkippedCheck ( ) : void
return void
		private void UpdateSkippedCheck()
		{
			lastCheck = DateTime.UtcNow;

			var totalSizeOnDisk = database.GetTotalSizeOnDisk();
			if (totalSizeOnDisk <= softLimit)
			{
				WarningMessagesHolder.RemoveWarnings(database, WarningPrefixName);
				skipCheck = VetoResult.Allowed;
				recheckOnDelete = false;
				return;
			}

			recheckOnDelete = true;

			string msg;
			if (totalSizeOnDisk > hardLimit) // beyond the grace margin
			{
				msg = string.Format("Database size is {0:#,#} KB, which is over the allowed quota of {1:#,#} KB. No more documents are allowed in.",
					totalSizeOnDisk / 1024, hardLimit / 1024);

				WarningMessagesHolder.AddWarning(database, WarningPrefixName, msg);
				skipCheck = VetoResult.Deny(msg);
			}
			else // still before the hard limit, warn, but allow
			{
				msg = string.Format("Database size is {0:#,#} KB, which is close to the allowed quota of {1:#,#} KB",
					totalSizeOnDisk / 1024, softLimit / 1024);

				WarningMessagesHolder.AddWarning(database, WarningPrefixName, msg);
				skipCheck = VetoResult.Allowed;
			}
		}