async void houseKeepingTimer_Elapsed(object sender, ElapsedEventArgs e) { using (var hl7Parser = new HL7Parser(httpClient)) { await hl7Parser.FillWardCache(); await hl7Parser.RemovBedsFromWards(); } }
protected override bool HandleException(Exception ex) { httpClient.ClearCache(); var t = Task.Run(async () => { using (var hl7Parser = new HL7Parser(httpClient)) await hl7Parser.FillWardCache(); }); t.Wait(); return false; }
public override void Start() { var t = Task.Run(async () => { using (var hl7Parser = new HL7Parser(httpClient)) await hl7Parser.FillWardCache(); }); t.Wait(); //houseKeepingTimer_Elapsed(null, null); base.Start(); houseKeepingTimer.Start(); }