public async Task <MyHtmlModel> GetMyHtmlModel(string path)
        {
            MyHtmlModel model = repository.GetHtmlModelByLink(path);

            if (model == null)
            {
                crawler = WebCrawler.GetInstance();
                model   = await crawler.GetMyHtmlModel(path);

                await repository.Create(model);
            }

            return(model);
        }
Exemple #2
0
 public static WebCrawler GetInstance()
 {
     Console.WriteLine($"GetInstance {DateTime.Now.TimeOfDay}");
     if (instance == null)
     {
         lock (syncRoot)
         {
             if (instance == null)
             {
                 instance = new WebCrawler();
             }
         }
     }
     return(instance);
 }