示例#1
0
        protected void Application_Start(Object sender, EventArgs e)
        {
            try
            {
                string path = ConfigurationManager.AppSettings["logPath"];
                if (path != null && path.Length > 0)
                {
                    Logger.LogPath = path;
                    Logger.WriteLine("");
                    Logger.WriteLine("#############################################################################");
                    Logger.WriteLine(iLabGlobal.Release);
                    Logger.WriteLine("Application_Start: starting");
                }
                ProcessAgentDB.RefreshServiceAgent();
                //Should load any active tasks and update any expired tasks
                LabDB dbService = new LabDB();

                TaskProcessor.Instance.WaitTime = 60000;
                LabTask[] activeTasks = dbService.GetActiveTasks();
                int count = 0;
                foreach (LabTask task in activeTasks)
                {
                    if (task != null)
                    {
                        if (task.storage != null && task.storage.Length > 0)
                        {
                            Coupon expCoupon = dbService.GetCoupon(task.couponID, task.issuerGUID);
                            DataSourceManager dsManager = new DataSourceManager(task);
                            BeeAPI api = new BeeAPI();
                            FileWatcherDataSource fds = api.CreateBeeDataSource(expCoupon, task, "data", false);
                            dsManager.AddDataSource(fds);
                            fds.Start();
                            TaskProcessor.Instance.AddDataManager(task.taskID, dsManager);
                        }
                        TaskProcessor.Instance.Add(new BeeTask(task));
                        count++;
                    }
                }
                taskThread = new TaskHandler(TaskProcessor.Instance);
                ticketRemover = new TicketRemover();
                if (Logger.IsLogging)
                    Logger.WriteLine("Added " + count + " active Tasks\r\n");

            }
            catch (Exception err)
            {
                if (Logger.IsLogging)
                Logger.WriteLine(Utilities.DumpException(err));
            }
        }
示例#2
0
 protected void Application_Start(Object sender, EventArgs e)
 {
     string path = ConfigurationManager.AppSettings["logPath"];
     if (path != null && path.Length > 0)
     {
        Logger.LogPath = path;
        Logger.WriteLine("");
        Logger.WriteLine("#############################################################################");
        Logger.WriteLine(iLabGlobal.Release);
        Logger.WriteLine("Application_Start: starting");
     }
     ProcessAgentDB.RefreshServiceAgent();
     //Should load any active tasks and update any expired tasks
     LabDB dbService = new LabDB();
     LabTask[] activeTasks = dbService.GetActiveTasks();
     if (activeTasks != null && activeTasks.Length > 0)
     {
         foreach (LabTask task in activeTasks)
         {
             if(task != null)
                 TaskProcessor.Instance.Add(task);
         }
     }
     taskThread = new TaskHandler(TaskProcessor.Instance);
     ticketRemover = new TicketRemover();
 }
示例#3
0
        protected void Application_Start(Object sender, EventArgs e)
        {
            string path = ConfigurationSettings.AppSettings["logPath"];
            if (path != null && path.Length > 0)
            {
                Utilities.LogPath = path;
                Utilities.WriteLog("");
                Utilities.WriteLog("#############################################################################");
                Utilities.WriteLog("");
                Utilities.WriteLog("Application_Start: starting");
            }

            //Should load any active tasks and update any expired tasks
            LabDB dbService = new LabDB();
            LabTask[] activeTasks = dbService.GetActiveTasks();
            foreach (LabTask task in activeTasks)
            {
                TaskProcessor.Instance.Add(task);
            }
            taskThread = new TaskHandler(TaskProcessor.Instance);
            ticketRemover = new TicketRemover();
        }