Example #1
0
        internal async Task StartInternalAsync()
        {
            try
            {
                _BuildDefinition = await GetBuildDefinitionDetails();

                if (_BuildDefinition == null)
                {
                    StatusChanged?.Invoke(Status.RetrievalError);
                    Log("Could not retrieve build definition details", Status.RetrievalError);
                    return;
                }

                Status? lastStatus = null;

                while (!_Token.IsCancellationRequested)
                {
                    Guid? correlationId = Guid.NewGuid();

                    try
                    {
                        RetrievingStatusStart?.Invoke(correlationId);
                        lastStatus = await GetVsoStatus(correlationId, lastStatus);
                    }
                    catch (Exception ex)
                    {
                        Log("ERROR: " + ex.Message);
                    }
                    finally
                    {
                        RetrievingStatusEnd?.Invoke(correlationId);
                        await Task.Delay(60000, _Token);
                    }
                }
            }
            finally
            {
                Stopped?.Invoke();
            }

        }
Example #2
0
        internal async Task StartInternalAsync()
        {
            try
            {
                _BuildDefinition = await GetBuildDefinitionDetails();

                if (_BuildDefinition == null)
                {
                    StatusChanged?.Invoke(Status.RetrievalError);
                    Log("Could not retrieve build definition details", Status.RetrievalError);
                    return;
                }

                Status?lastStatus = null;

                while (!_Token.IsCancellationRequested)
                {
                    Guid?correlationId = Guid.NewGuid();

                    try
                    {
                        RetrievingStatusStart?.Invoke(correlationId);
                        lastStatus = await GetVsoStatus(correlationId, lastStatus);
                    }
                    catch (Exception ex)
                    {
                        Log("ERROR: " + ex.Message);
                    }
                    finally
                    {
                        RetrievingStatusEnd?.Invoke(correlationId);
                        await Task.Delay(60000, _Token);
                    }
                }
            }
            finally
            {
                Stopped?.Invoke();
            }
        }