Skip to content
This repository was archived by the owner on Feb 2, 2022. It is now read-only.
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions src/APIService/ApiService/Program.fs
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,10 @@ open Swashbuckle.AspNetCore.SwaggerGen

module main =

let loadSchemaDocuments() =
let loadSchemaDocuments (settings : IConfiguration) =
async {
let utilsFileShare = Environment.GetEnvironmentVariable("RAFT_UTILS_FILESHARE")
let utilsSas = Environment.GetEnvironmentVariable("RAFT_UTILS_SAS")
let utilsFileShare = settings.["RAFT_UTILS_FILESHARE"]
let utilsSas = settings.["RAFT_UTILS_SAS"]

let directoryClient = Azure.Storage.Files.Shares.ShareDirectoryClient(utilsSas, utilsFileShare, "tools")

Expand Down Expand Up @@ -102,7 +102,7 @@ module main =
interface ISchemaFilter with
member this.Apply(schema: OpenApiSchema, context: SchemaFilterContext): unit =
if not (isNull context.MemberInfo) &&
context.MemberInfo.Name = "TaskConfiguration" &&
context.MemberInfo.Name = "ToolConfiguration" &&
context.MemberInfo.DeclaringType.Name = "RaftTask" then

let schemaDocuments = getSchemaDocuments (Utilities.toolsSchemas) |> Async.RunSynchronously
Expand Down Expand Up @@ -149,7 +149,7 @@ module main =
printfn "Initializing central telemetry"
ignore <| Central.Initialize (TelemetryClient(new TelemetryConfiguration(metricsKey), InstrumentationKey = metricsKey)) siteHash

Raft.Utilities.toolsSchemas <- loadSchemaDocuments () |> Async.RunSynchronously
Raft.Utilities.toolsSchemas <- loadSchemaDocuments settings |> Async.RunSynchronously
Raft.Utilities.serviceStartTime <- System.DateTimeOffset.UtcNow
Raft.Utilities.raftStorage <- Raft.Storage.RaftStorage(settings.[Constants.StorageTableConnectionString])
Raft.Utilities.serviceBusSenders <- Map.empty
Expand Down