public async Task <IHttpActionResult> NewClient() { var contract = await _contractQueueService.GetContract(); var response = new RegisterResponse { Contract = contract }; return(Ok(response)); }
/// <summary> /// Refreshe contracts queue every 12 hours /// </summary> /// <param name="timer"></param> /// <returns></returns> public async Task RefreshQueue([TimerTrigger("12:00:00")] TimerInfo timer) { for (var i = 0; i < _contractQueueService.Count(); i++) { try { var contract = await _contractQueueService.GetContract(); await _contractQueueService.PushContract(contract); } catch (Exception e) { await _logger.WriteError("EthereumWebJob", "RefreshQueue", "", e); } } }
public override async Task Execute() { for (var i = 0; i < _contractQueueService.Count(); i++) { try { var contract = await _contractQueueService.GetContract(); await _contractQueueService.PushContract(contract); } catch (Exception e) { await _logger.WriteError("EthereumWebJob", "RefreshQueue", "", e); } } }