Пример #1
0
        private void DoIntegrityCheckBetweenCatalogAndLucene()
        {
            DateTime startTime = Convert.ToDateTime(File.ReadAllText(CursorFileFullPath));
            DateTime endTime   = GetLastCommitTimeStampForLucene();
            HashSet <PackageEntry> catalogPackages           = V3Utility.GetCatalogPackages(CatalogRootUrl, CatalogStorageAccount, startTime, endTime);
            List <PackageEntry>    missingPackagesFromLucene = GetMissingPackagesFromLuceneAndRegistrationBlob(catalogPackages);

            if (missingPackagesFromLucene != null & missingPackagesFromLucene.Count > 0)
            {
                string missingPackagesString = string.Join(",", missingPackagesFromLucene.Select(e => e.ToString()).ToArray());
                Console.WriteLine("Missing Packages : {0}", missingPackagesString);
                new SendAlertMailTask
                {
                    AlertSubject = string.Format("Packages missing in V3 Lucene Index/RegistrationBlob"),
                    Details      = string.Format("List of packages that are found in catalog and missing either in Lucene Index/Registration Blob: {0}", missingPackagesString),
                    AlertName    = "Packages missing in V3 Lucene Index",
                    Component    = "V3 SearchService/RegistrationBlob",
                    Level        = "Error"
                }.ExecuteCommand();
            }
            else
            {
                //Update cursor only if validation succeeds.
                File.WriteAllText(CursorFileFullPath, endTime.ToString());
            }
        }
 private HashSet <PackageEntry> GetCatalogPackages()
 {
     return(V3Utility.GetCatalogPackages(CatalogRootUrl, CatalogStorageAccount));
 }