示例#1
0
        private void CheckSupportCoverage()
        {
            var licenseId = GetLicenseId();

            // non-commercial
            if (licenseId == null)
            {
                return;
            }


            SupportCoverageResult supportDoc;

            try
            {
                //try using fresh copy
                supportDoc = QueryForSupportCoverage(licenseId);
            }
            catch (Exception e)
            {
                log.WarnException("Failed to obtain support coverage information.", e);
                // use persisted copy if still valid
                supportDoc = GetSupportDocument(licenseId);
                if (supportDoc == null || supportDoc.EndsAt < SystemTime.UtcNow)
                {
                    supportDoc = CreateDefaultSupportCoverageDocument();
                }
            }
            PutSupportCoverage(licenseId, supportDoc);
            CurrentSupport = supportDoc;
        }
示例#2
0
        private void PutSupportCoverage(string id, SupportCoverageResult doc)
        {
            var docKey = GenerateSupportStatusDocKey(id);

            landlord.SystemDatabase.TransactionalStorage.Batch(action =>
            {
                action.Lists.Set(SupportCoverageList, docKey, RavenJObject.FromObject(doc), UuidType.SupportCoverage);
            });
        }