This commit is contained in:
Jamie Rees 2018-04-21 22:25:53 +01:00
parent b80ef04ab7
commit 0ce9fb2df9
3 changed files with 14 additions and 17 deletions

View file

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

View file

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

View file

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