Exemple #1
0
        public async Task <bool> fnThreadDBActionsAction()
        {
            // Check any Flights that is more than 60 * 3 seconds old, then
            // Generate the report and remove the flights
            foreach (String Key in WorkerProcess.Keys())
            {
                DroneDataProcessor TheFlight   = WorkerProcess.Flight(Key);
                Double             ElapsedTime = TheFlight.GetElapsed();

                if (ElapsedTime > 30)
                {
                    //Generate the report
                    await TheFlight.UpdateFlightSummary();

                    await TheFlight.GenerateReport();

                    WorkerProcess.RemoveProximity(Key);
                    WorkerProcess.RemoveFlight(Key);
                    TheFlight = null;
                }
            }
            //Update the Flight information back to Database
            await WorkerProcess.UpdateFlightsToDB();

            //Update Proximity of active flights
            await WorkerProcess.GenerateProximity();

            //Load list of alerts required to send
            await AlertQueue.LoadQueue();

            return(true);
        }