Пример #1
0
        private void SendSubscribtionNotification(IAbonnementProjet newAbo)
        {
            int delayNotif = CovCakeConfiguration.SubscriptionNotificationDelay;

            //TODO: a tester dans un contexte de charge importante (meme si yaura pas 10000 subscribtion en meme temps)
            //delayNotif = 10;
            DelayedTaskExecuter.ExecuteLaterAsync(delayNotif, (obj, timedOut) =>
            {
                IAbonnementProjet abo = obj as IAbonnementProjet;
                //Apres le delay on verifie si le mec est toujour bien inscrit et on envoi le mail
                lock (obj)
                {
                    if (abo.UserProfile.ParticipeA(abo.ProjetId))
                    {
                        try
                        {
                            CovCakeMailer.SendProjectSubscribtionNotify(abo);
                            CovCakeMailer.SendFriendsProjectSubscribNotify(abo);
                        }
                        catch (Exception)
                        {
                        }
                    }
                }
            }, newAbo);
        }