Finishing implementation of SendEvent (#1765)

This commit is contained in:
Cheick Keita
2022-04-11 09:32:09 -07:00
committed by GitHub
parent 9323d78c19
commit 5aceb25843
7 changed files with 63 additions and 28 deletions

View File

@ -3,6 +3,7 @@ using System.Collections.Generic;
using Microsoft.Extensions.Hosting;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.OneFuzz.Service.OneFuzzLib.Orm;
using ApiService.OneFuzzLib;
namespace Microsoft.OneFuzz.Service;
@ -33,8 +34,12 @@ public class Program
.ConfigureServices((context, services) =>
services
.AddSingleton<ILogTracerFactory>(_ => new LogTracerFactory(GetLoggers()))
.AddScoped<ILogTracer>(s => s.GetService<LogTracerFactory>()?.MakeLogTracer(Guid.NewGuid()) ?? throw new InvalidOperationException("Unable to create a logger"))
.AddSingleton<IStorageProvider>(_ => new StorageProvider(EnvironmentVariables.OneFuzz.FuncStorage ?? throw new InvalidOperationException("Missing account id")))
.AddSingleton<INodeOperations, NodeOperations>()
.AddSingleton<IEvents, Events>()
.AddSingleton<IWebhookOperations, WebhookOperations>()
.AddSingleton<IWebhookMessageLogOperations, WebhookMessageLogOperations>()
.AddSingleton<IQueue, Queue>()
.AddSingleton<ICreds>(_ => new Creds())
.AddSingleton<IStorage, Storage>()
)