mirror of
https://github.com/Ombi-app/Ombi.git
synced 2025-07-13 00:32:57 -07:00
Fixed #2170
This commit is contained in:
parent
b80ef04ab7
commit
0ce9fb2df9
3 changed files with 14 additions and 17 deletions
|
@ -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);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Check if it's in the startup args
|
||||||
|
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);
|
||||||
|
}
|
||||||
|
}
|
||||||
if (settings.BaseUrl.HasValue())
|
if (settings.BaseUrl.HasValue())
|
||||||
{
|
{
|
||||||
app.UsePathBase(settings.BaseUrl);
|
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;
|
|
||||||
if (baseUrl != null)
|
|
||||||
{
|
|
||||||
if (baseUrl.Value.HasValue())
|
|
||||||
{
|
|
||||||
settings.BaseUrl = baseUrl.Value;
|
|
||||||
ombiService.SaveSettings(settings);
|
|
||||||
|
|
||||||
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…
Add table
Add a link
Reference in a new issue