Exemplo n.º 1
0
        public async Task Execute(IJobExecutionContext context)
        {
            int count  = 500;
            int lastId = 0;

            while (true)
            {
                try
                {
                    var(records, nextLastId) = await _proxyService.GetPagedProxys(count, lastId);

                    if (records == null || records.Count <= 0)
                    {
                        break;
                    }

                    await _checkTaskQueue.EnqueueTaskItemAsync(records);

                    lastId = nextLastId;
                }
                catch (System.Exception ex)
                {
                    _logger.LogError(ex, ex.Message);
                }
            }
        }