Пример #1
0
        private static void RunDataService(string profiletype)
        {
            while (true)
            {
                try
                {

                    Api.SocialProfile.SocialProfile ApiobjSocialProfile = new Api.SocialProfile.SocialProfile();
                    List<Domain.Myfashion.Domain.SocialProfile> lstSocialProfile = (List<Domain.Myfashion.Domain.SocialProfile>)(new JavaScriptSerializer().Deserialize(ApiobjSocialProfile.SocialProfileByProfilType(profiletype.ToString()), typeof(List<Domain.Myfashion.Domain.SocialProfile>)));

                    ThreadPool.SetMaxThreads(20, 4);
                    if (lstSocialProfile != null)
                    {
                        if (lstSocialProfile.Count != 0)
                        {
                            foreach (var item in lstSocialProfile)
                            {
                                try
                                {
                                    try
                                    {
                                        ThreadPool.SetMaxThreads(20, 4);
                                        //if (item.UserId.ToString() != "62b4eb64-d942-40bc-8af3-2a8b3644f6e2")
                                        //{
                                        //    continue;
                                        //}
                                        RunDataServiceInThreads(item);
                                        //ThreadPool.QueueUserWorkItem(new WaitCallback(RunDataServiceInThreads), item);
                                        //RunDataServiceHardCodedAccountsInThreads(item);
                                    }
                                    catch (Exception ex)
                                    {
                                        Console.WriteLine(ex.Message);
                                    }
                                }
                                catch (Exception ex)
                                {
                                    Console.WriteLine(ex.Message);
                                }
                            }
                        }
                        else
                        {
                            Console.WriteLine("No active record in Database");
                        }
                    }
                    else
                    {
                        Console.WriteLine("No active record in Database");
                    }

                    Thread.Sleep(5 * 60 * 1000);
                }
                catch (Exception ex)
                {
                    Console.WriteLine(ex.Message);
                }
            }
        }
Пример #2
0
         private static void RunDataService(string profiletype)
        {
            while (true)
            {
             Api.SocialProfile.SocialProfile ApiobjSocialProfile=new Api.SocialProfile.SocialProfile ();
             List<Domain.Socioboard.Domain.SocialProfile> lstSocialProfile = (List<Domain.Socioboard.Domain.SocialProfile>)(new JavaScriptSerializer().Deserialize(ApiobjSocialProfile.SocialProfileByProfilType(profiletype.ToString()), typeof(List<Domain.Socioboard.Domain.SocialProfile>)));
            
                ThreadPool.SetMaxThreads(10, 4);           
                if (lstSocialProfile != null)
                {
                    if (lstSocialProfile.Count != 0)
                    {
                        foreach (var item in lstSocialProfile)
                        {
                            try
                            {
                                if (item.UserId.ToString()!="bbc23ca1-28f1-452c-a3a8-e58c5cc5a0f8")
                                {
                                    continue;
                                }

                                clsSocialSiteDataFeedsFactory objclsSocialSiteDataFeedsFactory = new clsSocialSiteDataFeedsFactory(item.ProfileType);
                                ISocialSiteData objSocialSiteDataFeeds = objclsSocialSiteDataFeedsFactory.CreateSocialSiteDataFeedsInstance();
                                if (objSocialSiteDataFeeds != null)
                                {
                                Console.WriteLine(objSocialSiteDataFeeds.GetData((object)item.UserId, item.ProfileId));
                                }
                            }
                            catch (Exception ex)
                            {
                                Console.WriteLine(ex.Message);
                            }
                        }
                    }
                    else
                    {

                        Console.WriteLine("No active record in Database");
                    }
                }
                else
                {
                    Console.WriteLine("No active record in Database");
                }

                Thread.Sleep(15*1000);
            }
        }
Пример #3
0
        private static void RunDataService(string profiletype)
        {
            while (true)
            {
                try
                {
                    Api.SocialProfile.SocialProfile ApiobjSocialProfile            = new Api.SocialProfile.SocialProfile();
                    List <Domain.Socioboard.Domain.SocialProfile> lstSocialProfile = (List <Domain.Socioboard.Domain.SocialProfile>)(new JavaScriptSerializer().Deserialize(ApiobjSocialProfile.SocialProfileByProfilType(profiletype.ToString()), typeof(List <Domain.Socioboard.Domain.SocialProfile>)));

                    ThreadPool.SetMaxThreads(20, 4);
                    if (lstSocialProfile != null)
                    {
                        if (lstSocialProfile.Count != 0)
                        {
                            foreach (var item in lstSocialProfile)
                            {
                                try
                                {
                                    try
                                    {
                                        ThreadPool.SetMaxThreads(20, 4);
                                        RunDataServiceInThreads(item);
                                        //ThreadPool.QueueUserWorkItem(new WaitCallback(RunDataServiceInThreads), item);
                                        //RunDataServiceHardCodedAccountsInThreads(item);
                                    }
                                    catch (Exception ex)
                                    {
                                        Console.WriteLine(ex.Message);
                                    }
                                }
                                catch (Exception ex)
                                {
                                    Console.WriteLine(ex.Message);
                                }
                            }
                        }
                        else
                        {
                            Console.WriteLine("No active record in Database");
                        }
                    }
                    else
                    {
                        Console.WriteLine("No active record in Database");
                    }

                    Thread.Sleep(5 * 60 * 1000);
                }
                catch (Exception ex)
                {
                    Console.WriteLine(ex.Message);
                }
            }
        }
Пример #4
0
        private static void RunDataService(string profiletype)
        {
            while (true)
            {
                Api.SocialProfile.SocialProfile ApiobjSocialProfile            = new Api.SocialProfile.SocialProfile();
                List <Domain.Socioboard.Domain.SocialProfile> lstSocialProfile = (List <Domain.Socioboard.Domain.SocialProfile>)(new JavaScriptSerializer().Deserialize(ApiobjSocialProfile.SocialProfileByProfilType(profiletype.ToString()), typeof(List <Domain.Socioboard.Domain.SocialProfile>)));

                ThreadPool.SetMaxThreads(10, 4);
                if (lstSocialProfile != null)
                {
                    if (lstSocialProfile.Count != 0)
                    {
                        foreach (var item in lstSocialProfile)
                        {
                            try
                            {
                                clsSocialSiteDataFeedsFactory objclsSocialSiteDataFeedsFactory = new clsSocialSiteDataFeedsFactory(item.ProfileType);
                                ISocialSiteData objSocialSiteDataFeeds = objclsSocialSiteDataFeedsFactory.CreateSocialSiteDataFeedsInstance();
                                if (objSocialSiteDataFeeds != null)
                                {
                                    Console.WriteLine(objSocialSiteDataFeeds.GetData((object)item.UserId, item.ProfileId));
                                }
                            }
                            catch (Exception ex)
                            {
                                Console.WriteLine(ex.Message);
                            }
                        }
                    }
                    else
                    {
                        Console.WriteLine("No active record in Database");
                    }
                }
                else
                {
                    Console.WriteLine("No active record in Database");
                }

                Thread.Sleep(15 * 1000);
            }
        }
Пример #5
0
        private static void RunDataServiceSirAccount(string profiletype)
        {
            while (true)
            {
                try
                {
                    Api.SocialProfile.SocialProfile ApiobjSocialProfile = new Api.SocialProfile.SocialProfile();
                    List<Domain.Myfashion.Domain.SocialProfile> lstSocialProfile = (List<Domain.Myfashion.Domain.SocialProfile>)(new JavaScriptSerializer().Deserialize(ApiobjSocialProfile.SocialProfileByProfilType(profiletype.ToString()), typeof(List<Domain.Myfashion.Domain.SocialProfile>)));

                    ThreadPool.SetMaxThreads(20, 4);
                    if (lstSocialProfile != null)
                    {
                        if (lstSocialProfile.Count != 0)
                        {
                            foreach (var item in lstSocialProfile)
                            {
                                if ((item.UserId.ToString() != "e855ee26-da94-452f-ba74-5ef7e252083e") && (item.UserId.ToString() != "86ff0ec0-2ccd-4110-8c3b-5bd1e37cdced") && (item.UserId.ToString() != "2350e2cf-c790-4253-b17f-1f284fa244d5"))
                                {
                                    continue;
                                }
                                try
                                {
                                    ThreadPool.SetMaxThreads(20, 4);
                                    //ThreadPool.QueueUserWorkItem(new WaitCallback(RunDataServiceInThreads), item);
                                    RunDataServiceInThreads(item);
                                }
                                catch (Exception ex)
                                {
                                    Console.WriteLine(ex.Message);
                                }
                            }
                        }
                        else
                        {
                            Console.WriteLine("No active record in Database");
                        }
                    }
                    else
                    {
                        Console.WriteLine("No active record in Database");
                    }

                    Thread.Sleep(5 * 60 * 1000); //Thread.Sleep(15 * 1000);
                }
                catch (Exception ex)
                {
                    Console.WriteLine(ex.Message);
                }
            }
        }
Пример #6
0
        private static void RunDataServiceSirAccount(string profiletype)
        {
            while (true)
            {
                try
                {
                    Api.SocialProfile.SocialProfile ApiobjSocialProfile           = new Api.SocialProfile.SocialProfile();
                    List <Domain.Myfashion.Domain.SocialProfile> lstSocialProfile = (List <Domain.Myfashion.Domain.SocialProfile>)(new JavaScriptSerializer().Deserialize(ApiobjSocialProfile.SocialProfileByProfilType(profiletype.ToString()), typeof(List <Domain.Myfashion.Domain.SocialProfile>)));

                    ThreadPool.SetMaxThreads(20, 4);
                    if (lstSocialProfile != null)
                    {
                        if (lstSocialProfile.Count != 0)
                        {
                            foreach (var item in lstSocialProfile)
                            {
                                if ((item.UserId.ToString() != "e855ee26-da94-452f-ba74-5ef7e252083e") && (item.UserId.ToString() != "86ff0ec0-2ccd-4110-8c3b-5bd1e37cdced") && (item.UserId.ToString() != "2350e2cf-c790-4253-b17f-1f284fa244d5"))
                                {
                                    continue;
                                }
                                try
                                {
                                    ThreadPool.SetMaxThreads(20, 4);
                                    //ThreadPool.QueueUserWorkItem(new WaitCallback(RunDataServiceInThreads), item);
                                    RunDataServiceInThreads(item);
                                }
                                catch (Exception ex)
                                {
                                    Console.WriteLine(ex.Message);
                                }
                            }
                        }
                        else
                        {
                            Console.WriteLine("No active record in Database");
                        }
                    }
                    else
                    {
                        Console.WriteLine("No active record in Database");
                    }

                    Thread.Sleep(5 * 60 * 1000); //Thread.Sleep(15 * 1000);
                }
                catch (Exception ex)
                {
                    Console.WriteLine(ex.Message);
                }
            }
        }