public void Send(MauticForm mauticForm) { var client = new Client(mauticForm.DestinyAddress, mauticForm.ContentType, mauticForm.Headers, mauticForm.Body); try { if (mauticForm.HttpMethod == HttpMethod.Post) { client.Post(); } else { client.Get(); } mauticForm.UpdateStatus(MauticFormStatus.Sent); mauticForm.SetUpdatedAt(); _mauticFormRepository.Update(mauticForm); } catch { mauticForm.UpdateStatus(MauticFormStatus.Failed); mauticForm.SetUpdatedAt(); _mauticFormRepository.Update(mauticForm); } }
private async Task StartProcessingMauticForm(MauticForm mauticForm) { mauticForm.UpdateStatus(MauticFormStatus.InProcess); mauticForm.SetUpdatedAt(); await _mauticFormRepository.Update(mauticForm); }