//private bool IsFirstTimeCalled { get; set; } = true; private async Task ScheduleMissionAsync() { //// 延迟第一次调用 //if (IsFirstTimeCalled) //{ // IsFirstTimeCalled = false; // await Delay(1000 * 60); // return; //} if (IsFastSchedule) { IsFastSchedule = false; await Delay(1000 * 60); if (!MissionReturnOfTheKing.IsScheduled && !MissionReturnOfTheKing.IsRunning) { var missionInfo = GetMissionInfoSynced(); MissionReturnOfTheKing.MissionInfo = missionInfo; MissionReturnOfTheKing.Schedule(); } return; } else if (IsReachScheduleInterval) { if (!MissionReturnOfTheKing.IsScheduled && !MissionReturnOfTheKing.IsRunning) { var missionInfo = GetMissionInfoSynced(); MissionReturnOfTheKing.MissionInfo = missionInfo; MissionReturnOfTheKing.Schedule(); } } await Delay(1000 * 60); }
private async Task ScheduleMissionAsync() { // 延迟第一次调用 if (IsFirstTimeCalled) { IsFirstTimeCalled = false; await Delay(1000 * 30); return; } if (IsFastSchedule || IsReachScheduleInterval) { IsFastSchedule = false; if (!MissionReturnOfTheKing.IsScheduled && !MissionReturnOfTheKing.IsRunning) { var missionInfo = GetMissionInfoSynced(); MissionReturnOfTheKing.MissionInfo = missionInfo; MissionReturnOfTheKing.Schedule(); } } await Delay(1000 * 30); }