コード例 #1
0
        protected override VcssTaskCanScheduleResult CanSchedule(VcssTaskInfoModel vcssTaskInfo)
        {
            DateTime marketTime = DateTime.UtcNow.AddHours(vcssTaskInfo.Market.utc_offset);

            if (marketTime.TimeOfDay.Hours == 5 && marketTime.DayOfWeek != DayOfWeek.Saturday && marketTime.DayOfWeek != DayOfWeek.Sunday && !HolidayService.IsHoliday(vcssTaskInfo.market_id.Value, marketTime))
            {
                return(VcssTaskCanScheduleResult.Schedule);
            }
            return(VcssTaskCanScheduleResult.InvalidTime);
        }