Ejemplo n.º 1
0
        public void ReQeueFailedJobs(int nMaxRetries)
        {
            #region LOG
            {
                string message = @"ReQeueFailedJobs";
                Logger.Global.Log(string.Empty, string.Empty, -1, string.Empty, string.Empty, -1, DicomCommandType.Undefined, DateTime.Now,
                                  LogType.Information, MessageDirection.None, message, null, null);
            }
            #endregion


            List <JobProxy> jpList = new List <JobProxy>();

            {
                ListJobsFlags nFlags = ListJobsFlags.None;

                nFlags |= ListJobsFlags.Status;
                nFlags |= ListJobsFlags.CompletedStatus;
                nFlags |= ListJobsFlags.NegateCompletedStatus;
                nFlags |= ListJobsFlags.Retries;

                string[] sIds = DownloadJobsDataAccessAgent.ListJobs("", (int)JobProxy.Status.completed, (int)JobProxy.CompletedStatus.success, nMaxRetries, nFlags);

                foreach (string sId in sIds)
                {
                    try
                    {
                        DownloadJobsDataAccessAgent.SetJobStatus(int.Parse(sId), (int)JobProxy.Status.pending, (int)JobProxy.CompletedStatus.undefined, false, "");
                        QeueJob(sId);
                    }
                    catch (Exception e)
                    {
                        #region LOG
                        {
                            string message = @"ReQeueFailedJob Failure: " + e.Message;
                            Logger.Global.Log(string.Empty, string.Empty, -1, string.Empty, string.Empty, -1, DicomCommandType.Undefined, DateTime.Now,
                                              LogType.Information, MessageDirection.None, message, null, null);
                        }
                        #endregion

                        System.Diagnostics.Debug.Assert(false);
                    }
                }
            }
        }
Ejemplo n.º 2
0
 private void SetPending()
 {
     CheckHasId();
     _DownloadJobsDataAccessAgent.SetJobStatus(Id, (int)Status.pending, (int)CompletedStatus.failed, false, "");
 }