示例#1
0
        /// <summary>
        /// This method updates all the backends next collecting time in Azure Referencedata table
        /// This method triggered based on given time interval(i.e MyDailyScheduleForUpdateNextCollectingTime)
        /// it is scheduled by every hour
        /// </summary>
        public static void ForEachBackendSetNextCollectingTime([TimerTrigger(typeof(MyDailyScheduleForUpdateNextCollectingTime))] TimerInfo timerInfo, TextWriter log)
        {
            string callerMethodName = string.Empty;

            try
            {
                //Get Caller Method name from CallerInformation class
                callerMethodName = CallerInformation.TrackCallerMethodName();
                bool IsFirstTime = false;
                ////Create object for NextUserCollectingTime class
                NextUserCollectingTimeDAL objdal = new NextUserCollectingTimeDAL();
                //call the UpdateNextCollectingTime method which will update the Next Collecting Time of the each backend
                objdal.UpdateNextCollectingTime(IsFirstTime);
                // InsightLogger.TrackEndEvent(callerMethodName);
            }
            catch (DataAccessException dalexception)
            {
                //write exception message to web job dashboard logs
                //log.WriteLine(dalexception.Message);
                //write data layer exception into application insights
                InsightLogger.Exception(dalexception.Message, dalexception, callerMethodName);
            }
            catch (Exception exception)
            {
                //log.WriteLine("Error in adidas.clb.job.UpdateTriggering :: Functions :: UpdateNextCollectingTimeForAllBackends() :: Exception Message=" + exception.Message);
                //write exception into application insights
                InsightLogger.Exception(exception.Message, exception, callerMethodName);
            }
        }
示例#2
0
        public static void UpdateNextCollectingTime()
        {
            string callerMethodName = string.Empty;

            try
            {
                //Get Caller Method name from CallerInformation class
                callerMethodName = CallerInformation.TrackCallerMethodName();
                ////Create object for NextUserCollectingTime class
                bool IsFirstTime = true;
                NextUserCollectingTimeDAL objdal = new NextUserCollectingTimeDAL();
                //call the UpdateNextCollectingTime method which will update the Next Collecting Time of the each backend
                objdal.UpdateNextCollectingTime(IsFirstTime);
            }
            catch (DataAccessException dalexception)
            {
                //write data layer exception into application insights
                InsightLogger.Exception(dalexception.Message, dalexception, callerMethodName);
            }
            catch (Exception exception)
            {
                //write exception into application insights
                InsightLogger.Exception(exception.Message, exception, callerMethodName);
            }
        }