pull/2194/head
Jamie Rees 7 years ago
parent b80ef04ab7
commit 0ce9fb2df9

@ -81,6 +81,7 @@ namespace Ombi.Store.Repository
public void Update(GlobalSettings entity) public void Update(GlobalSettings entity)
{ {
Db.Update(entity);
//_cache.Remove(GetName(entity.SettingsName)); //_cache.Remove(GetName(entity.SettingsName));
Db.SaveChanges(); Db.SaveChanges();
} }

@ -82,7 +82,7 @@ namespace Ombi
ctx.SaveChanges(); ctx.SaveChanges();
} }
} }
else if(!baseUrl.Equals(dbBaseUrl.Value)) else if(baseUrl.HasValue() && !baseUrl.Equals(dbBaseUrl.Value))
{ {
dbBaseUrl.Value = baseUrl; dbBaseUrl.Value = baseUrl;
ctx.SaveChanges(); ctx.SaveChanges();

@ -173,26 +173,22 @@ namespace Ombi
settings.ApiKey = Guid.NewGuid().ToString("N"); settings.ApiKey = Guid.NewGuid().ToString("N");
ombiService.SaveSettings(settings); ombiService.SaveSettings(settings);
} }
if (settings.BaseUrl.HasValue())
{ // Check if it's in the startup args
app.UsePathBase(settings.BaseUrl); var appConfig = serviceProvider.GetService<IApplicationConfigRepository>();
} var baseUrl = appConfig.Get(ConfigurationTypes.BaseUrl).Result;
else if (baseUrl != null)
{ {
// Check if it's in the startup args if (baseUrl.Value.HasValue())
var appConfig = serviceProvider.GetService<IApplicationConfigRepository>();
var baseUrl = appConfig.Get(ConfigurationTypes.BaseUrl).Result;
if (baseUrl != null)
{ {
if (baseUrl.Value.HasValue()) settings.BaseUrl = baseUrl.Value;
{ ombiService.SaveSettings(settings);
settings.BaseUrl = baseUrl.Value;
ombiService.SaveSettings(settings);
app.UsePathBase(settings.BaseUrl);
}
} }
} }
if (settings.BaseUrl.HasValue())
{
app.UsePathBase(settings.BaseUrl);
}
app.UseHangfireServer(new BackgroundJobServerOptions { WorkerCount = 1, ServerTimeout = TimeSpan.FromDays(1), ShutdownTimeout = TimeSpan.FromDays(1)}); app.UseHangfireServer(new BackgroundJobServerOptions { WorkerCount = 1, ServerTimeout = TimeSpan.FromDays(1), ShutdownTimeout = TimeSpan.FromDays(1)});
app.UseHangfireDashboard(settings.BaseUrl.HasValue() ? $"{settings.BaseUrl}/hangfire" : "/hangfire", app.UseHangfireDashboard(settings.BaseUrl.HasValue() ? $"{settings.BaseUrl}/hangfire" : "/hangfire",

Loading…
Cancel
Save