#2994 Fixed the startup issue

This commit is contained in:
tidusjar 2019-07-06 08:11:08 +01:00
commit f85ee3e144
2 changed files with 5 additions and 10 deletions

View file

@ -20,8 +20,6 @@ namespace Ombi
{ {
Console.Title = "Ombi"; Console.Title = "Ombi";
SQLitePCL.raw.sqlite3_config(2);
var host = string.Empty; var host = string.Empty;
var storagePath = string.Empty; var storagePath = string.Empty;
var baseUrl = string.Empty; var baseUrl = string.Empty;

View file

@ -4,6 +4,7 @@ using AutoMapper;
using AutoMapper.EquivalencyExpression; using AutoMapper.EquivalencyExpression;
using Hangfire; using Hangfire;
using Hangfire.Dashboard; using Hangfire.Dashboard;
using Hangfire.MemoryStorage;
using Hangfire.SQLite; using Hangfire.SQLite;
using Microsoft.AspNetCore.Builder; using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting; using Microsoft.AspNetCore.Hosting;
@ -90,19 +91,15 @@ namespace Ombi
services.AddSwagger(); services.AddSwagger();
services.AddAppSettingsValues(Configuration); services.AddAppSettingsValues(Configuration);
var i = StoragePathSingleton.Instance;
if (string.IsNullOrEmpty(i.StoragePath))
{
i.StoragePath = string.Empty;
}
var sqliteStorage = $"Data Source={Path.Combine(i.StoragePath, "Schedules.db")};";
services.AddHangfire(x => services.AddHangfire(x =>
{ {
x.UseSQLiteStorage(sqliteStorage); x.UseMemoryStorage();
x.UseActivator(new IoCJobActivator(services.BuildServiceProvider())); x.UseActivator(new IoCJobActivator(services.BuildServiceProvider()));
}); });
SQLitePCL.raw.sqlite3_config(2);
services.AddCors(o => o.AddPolicy("MyPolicy", builder => services.AddCors(o => o.AddPolicy("MyPolicy", builder =>
{ {
builder.AllowAnyOrigin() builder.AllowAnyOrigin()