| | |
| | | |
| | | namespace GZ.Projects.AuxAllWCS |
| | | { |
| | | public static class ExtendClass |
| | | { |
| | | public static void Disnull(this TaskRepository repository) |
| | | { |
| | | repository.dbcontext.Dispose(); |
| | | repository = null; |
| | | } |
| | | public static void Disnull(this LocRepository repository) |
| | | { |
| | | repository.dbcontext.Dispose(); |
| | | repository = null; |
| | | } |
| | | public static void Disnull(this TaskActRepository repository) |
| | | { |
| | | repository.dbcontext.Dispose(); |
| | | repository = null; |
| | | } |
| | | public static void Disnull(this SYSRepository repository) |
| | | { |
| | | repository.dbcontext.Dispose(); |
| | | repository = null; |
| | | } |
| | | } |
| | | public partial class AutoThread |
| | | { |
| | | |
| | |
| | | public void ThreaTotal(Tag tag, Device device) |
| | | { |
| | | List<Task> tasks = new List<Task>(); |
| | | LogHelper.Info("ThreaTotal 绾跨▼鎬荤嚎鍚姩"); |
| | | tasks.Add(GetTask(delegate (Tag tag1, Device device1) |
| | | { |
| | | try |
| | |
| | | tasks.Add(GetTask(ThreadMXC5, tag, 3000)); |
| | | tasks.Add(GetTask(ThreadMXC6, tag, 3000)); |
| | | |
| | | LogHelper.Info("ThreaTotal 绾跨▼鎬荤嚎runing"); |
| | | Task.WaitAll(tasks.ToArray()); |
| | | LogHelper.Info("ThreaTotal 绾跨▼鎬荤嚎over"); |
| | | } |
| | | void taskssss1(Tag tag) |
| | | { |
| | |
| | | } |
| | | } |
| | | } |
| | | task1 = null; |
| | | task2 = null; |
| | | LogHelper.Info($"rgv 澶勭悊瀹屾垚銆倀askend 125"); |
| | | #endregion |
| | | } |
| | |
| | | TaskRepository taskRepository = new TaskRepository(); |
| | | try |
| | | { |
| | | |
| | | var requires1 = taskActRepository.FindList(x => taskCOdes.Contains(x.S_ACTION_CODE) && x.N_CREATEMETHOD == 0).OrderBy(x => x.T_CREATE).ToList(); |
| | | var timeMorhours = requires1.FindAll(x => DateTime.Now.Subtract(x.T_CREATE).TotalHours > 1); |
| | | if (timeMorhours.Any()) |
| | |
| | | } |
| | | |
| | | } |
| | | requires1 = null; |
| | | timeMorhours = null; |
| | | } |
| | | catch (Exception ex) |
| | | { |