Beispiel #1
0
        async Task MessageConsumer_TestResultStateAcquiredAsync(TestResultStateAcquiredMessage arg)
        {
            using var scope = ScopeFactory.CreateScope();
            using var db    = scope.ServiceProvider.GetRequiredService <RunnerContext>();

            var rr = db.RunResults
                     .IncludeGroup(API.Models.EntityGroups.ALL, db)
                     .FirstOrDefault(r => r.Id == arg.ResultId);

            if (rr != null)
            {
                rr.ResultBase.State = arg.NewState;
                await db.SaveChangesAsync();

                MessageProducer.FireTestResultStateUpdated(new TestResultStateUpdatedMessage(rr.ResultBase.TestId, arg.ResultId, arg.NewState));
            }
        }