Skip to content

Commit

Permalink
Load JsonBackedCache filename from config
Browse files Browse the repository at this point in the history
  • Loading branch information
bleunguts committed Feb 13, 2024
1 parent 6fbd4b1 commit ac5037a
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 1 deletion.
1 change: 1 addition & 0 deletions .github/workflows/managedEnv20231128015747.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ jobs:
resourceGroup: ${{ env.RESOURCE_GROUP }}
ingress: external
targetPort: 8080
location: UK South
buildWeb:
runs-on: ubuntu-latest
steps:
Expand Down
2 changes: 1 addition & 1 deletion ProjectX.GatewayAPI/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ public void ConfigureServices(IServiceCollection services)
services.TryAddScoped<IPricingTasksProcessor, PricingTasksProcessor>();
services.AddSingleton<IStockMarketSource>(new FileBackedStockMarketDataSource(
new FMPStockMarketSource(),
Options.Create(new FileBackedStoreMarketDataSourceOptions() { Filename = "cache.json"}))
Options.Create(new FileBackedStoreMarketDataSourceOptions() { Filename = Configuration.GetSection("MarketData")["CacheFilename"] }))
);
services.AddSingleton<IStockSignalService, StockSignalService>();
services.AddSingleton<IBacktestService, BacktestService>();
Expand Down
3 changes: 3 additions & 0 deletions ProjectX.GatewayAPI/appsettings.Development.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@
"ExternalServices": {
"ProjectXUrl": "https://localhost:8081"
},
"MarketData": {
"CacheFilename": "cache.json"
},
"FX": {
"RawSpreadInPips": 25,
"IntervalBetweenSends": 500
Expand Down
3 changes: 3 additions & 0 deletions ProjectX.GatewayAPI/appsettings.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@
"ExternalServices": {
"ProjectXUrl": "http://localhost:8080/"
},
"MarketData": {
"CacheFilename": "cache.json"
}
"FX": {
"RawSpreadInPips": 25,
"IntervalBetweenSends": 200
Expand Down

0 comments on commit ac5037a

Please sign in to comment.