コード例 #1
0
        public async Task <IHttpActionResult> NewClient()
        {
            var contract = await _contractQueueService.GetContract();

            var response = new RegisterResponse
            {
                Contract = contract
            };

            return(Ok(response));
        }
コード例 #2
0
        /// <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);
                }
            }
        }
コード例 #3
0
        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);
                }
            }
        }