Add in CronJob to update the Financial Data every 2 days
This commit is contained in:
+27
-21
@@ -2,8 +2,6 @@ using WebServer.Components;
|
||||
using PythonInterop;
|
||||
using DataBase;
|
||||
|
||||
var builder = WebApplication.CreateBuilder(args);
|
||||
|
||||
// Load the module in globally and use correct path for local or docker runners
|
||||
#if DEBUG
|
||||
AIModule interopModule = new AIModule(PythonPathBase: "/usr/", PythonVersion: "python3.11");
|
||||
@@ -11,29 +9,37 @@ var builder = WebApplication.CreateBuilder(args);
|
||||
AIModule interopModule = new AIModule();
|
||||
#endif
|
||||
|
||||
// Add services to the container.
|
||||
builder.Services.AddRazorComponents().AddInteractiveServerComponents();
|
||||
if (args.Contains("Pull-Stock-Data")) {
|
||||
interopModule.PullData();
|
||||
} else {
|
||||
// Create the webapp
|
||||
var builder = WebApplication.CreateBuilder(args);
|
||||
|
||||
// Insert the DB driver for Dependency Injection
|
||||
builder.Services.AddSingleton<DbDriver>();
|
||||
// Add services to the container.
|
||||
builder.Services.AddRazorComponents().AddInteractiveServerComponents();
|
||||
|
||||
// Insert the python modlue for Dependency Injection
|
||||
builder.Services.AddSingleton(interopModule);
|
||||
// Insert the DB driver for Dependency Injection
|
||||
builder.Services.AddSingleton<DbDriver>();
|
||||
|
||||
var app = builder.Build();
|
||||
// Insert the python modlue for Dependency Injection
|
||||
builder.Services.AddSingleton(interopModule);
|
||||
|
||||
// Configure the HTTP request pipeline.
|
||||
if (!app.Environment.IsDevelopment()) {
|
||||
app.UseExceptionHandler("/Error", createScopeForErrors: true);
|
||||
// The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts.
|
||||
app.UseHsts();
|
||||
}
|
||||
// Build the app
|
||||
var app = builder.Build();
|
||||
|
||||
app.UseHttpsRedirection();
|
||||
// Configure the HTTP request pipeline.
|
||||
if (!app.Environment.IsDevelopment()) {
|
||||
app.UseExceptionHandler("/Error", createScopeForErrors: true);
|
||||
// The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts.
|
||||
app.UseHsts();
|
||||
}
|
||||
|
||||
app.UseAntiforgery();
|
||||
// Conffigure policies
|
||||
app.UseHttpsRedirection();
|
||||
app.UseAntiforgery();
|
||||
app.MapStaticAssets();
|
||||
app.MapRazorComponents<App>().AddInteractiveServerRenderMode();
|
||||
|
||||
app.MapStaticAssets();
|
||||
app.MapRazorComponents<App>().AddInteractiveServerRenderMode();
|
||||
|
||||
app.Run();
|
||||
// Start the web app
|
||||
app.Run();
|
||||
}
|
||||
Reference in New Issue
Block a user