예제 #1
0
        public bool Proccess(ProgramacaoTarefa programacaoTarefa)
        {
            var           log      = new Util.Log(ConfigurationManager.AppSettings["LogServico"]);
            RestDto <Log> response = null;

            try
            {
                _processBatch = new Repository.ApiClient.ProcessBatch(string.Empty, programacaoTarefa?.Tarefa.UrlAPI);
                response      = _processBatch.Process(programacaoTarefa).Result;
                if (response.StatusCode == HttpStatusCode.Unauthorized)
                {
                    this.RenovaToken();
                    this.Proccess(programacaoTarefa);
                }
            }
            catch (Exception ex)
            {
                log.Escreve_Log($"URL Chamada: { programacaoTarefa.Tarefa.UrlAPI}");
                log.Escreve_Log(ex.Message);
                log.Escreve_Log(ex?.StackTrace);
                log.Escreve_Log(ex?.InnerException?.Message);
            }
            return(response.Success);
        }
 public void TestPassingInterfaceAsParam(IProcessBatch batch)
 {
     Console.WriteLine(batch.Name);
 }