Exemple #1
0
 public string AddFeed(string newFeed)
 {
     if (_ctx.Feeds.Any(f => f.Url == newFeed))
     {
         return("This feed is already in DB!");
     }
     _ctx.Feeds.Add(new Feed {
         Url = newFeed, Active = true
     });
     _ctx.SaveChanges();
     RssLogic.UpdateServerConnection();
     return("Success !");
 }
Exemple #2
0
        protected override void OnStart(string[] args)
        {
            thDownload        = new SynThread("Download", 5000, PerformDownload);
            thProcessArticles = new SynThread("ProcessingArticles", 1001, PerformArticleProcessing);
            thProcessShingles = new SynThread("ProcessingShingles", 1111, PerformShingleProcessing);
            //thIntrinio = new SynThread("Intrinio", 24000 * 3600 / 450, PerformIntrinio);
            //thIntrinio = new SynThread("Intrinio", 24000 * 3600 / 45, PerformIntrinio);

            RssLogic.UpdateServerConnection();
            using (var ctx = new Db())
            {
                RssLogic.AddNewFeedsFromResource(ctx);
            }
            StartThread(thDownload);
            //StartThread(thProcessShingles);
            StartThread(thProcessArticles);
            //StartThread(thIntrinio);
        }