private static void SaveLastPeriodicTaskStartTime(CmsBackgroundTask task, DateTime startTime)
        {
            string persistentVariableName = getLastStartPersistentVariableName(task);
            CmsPersistentVariable v       = CmsPersistentVariable.Fetch(persistentVariableName);

            v.Name           = persistentVariableName;
            v.PersistedValue = startTime;

            v.SaveToDatabase();
        }
        /// <summary>
        /// returns DateTime.MinValue if the task has never been run, or if the last run time could not be determined.
        /// </summary>
        /// <param name="task"></param>
        /// <returns></returns>
        private static DateTime GetLastPeriodicTaskStartTime(CmsBackgroundTask task)
        {
            string persistentVariableName = getLastStartPersistentVariableName(task);
            CmsPersistentVariable v       = CmsPersistentVariable.Fetch(persistentVariableName);

            if (v.Name == persistentVariableName)
            {
                return((DateTime)v.PersistedValue);
            }
            return(DateTime.MinValue);
        }