public WarmUpController(VBDbContext db, VBThreadManager threadManager, VBSessionManager sessionManager, VBSettingsManager settingsManager, VBForumManager forumManager, VBUserManager userManager)
 {
     this.db              = db;
     this.threadManager   = threadManager;
     this.sessionManager  = sessionManager;
     this.settingsManager = settingsManager;
     this.forumManager    = forumManager;
     this.userManager     = userManager;
 }
 public SettingsController(VBSettingsManager settingsManager)
 {
     this.settingsManager = settingsManager;
 }
Exemplo n.º 3
0
        static void WarmUpManagers(VBThreadManager threadManager, VBSessionManager sessionManager, VBSettingsManager settingsManager, VBForumManager forumManager, VBUserManager userManager, VBThread thread, VBUser user, VBSession session)
        {
            var managerThread = threadManager.GetThreadAsync(thread.Id, writeable: true).Result;
            var replys        = threadManager.GetReplysAsync(thread.Id, start: 0, count: 1).Result;
            var settings      = settingsManager.GetCommonSettings();

            if (session != null)
            {
                // Do not update last activity since we're not in a http context => No request path avaliable
                var managerSession = sessionManager.GetAsync(session.SessionHash, updateLastActivity: false).Result;
            }

            if (user != null)
            {
                var forum = forumManager.GetCategoriesWhereUserCanAsync(user.UserGroup).Result;
                var randomUserFromManager = userManager.GetUserAsync(user.Id).Result;
            }
        }
Exemplo n.º 4
0
        public static void WarmUpServices(VBDbContext db, VBThreadManager threadManager, VBSessionManager sessionManager, VBSettingsManager settingsManager, VBForumManager forumManager, VBUserManager userManager)
        {
            var attachment   = db.Attachments.FirstOrDefault();
            var customAvatar = db.CustomAvatars.FirstOrDefault();
            var forumPerm    = db.ForumPermissions.FirstOrDefault();
            var forum        = db.Forums.FirstOrDefault();
            var message      = db.Messages.FirstOrDefault();
            var messageText  = db.MessagesText.FirstOrDefault();
            var poll         = db.Polls.FirstOrDefault();
            var post         = db.Posts.FirstOrDefault();
            var thanks       = db.PostThanks.FirstOrDefault();
            var session      = db.Sessions.FirstOrDefault();
            var setting      = db.Settings.FirstOrDefault();
            var threadRead   = db.ThreadReads.FirstOrDefault();
            var thread       = db.Threads.FirstOrDefault();
            var group        = db.UserGroups.FirstOrDefault();
            var user         = db.Users.Include(u => u.UserGroup)
                               .FirstOrDefault();

            WarmUpManagers(threadManager, sessionManager, settingsManager, forumManager, userManager, thread, user, session);
        }