mirror of
https://github.com/lidarr/lidarr.git
synced 2025-08-20 13:33:34 -07:00
Fixed: Slower startup loop on DB initialization failure
Wrap any exception thrown in a LidarrStartupException to trigger the existing bootloop code. We have to catch the generic Exception class since FluentMigrator rethrows all exceptions as a generic Exception.
This commit is contained in:
parent
d7e406dccb
commit
59cc5584c6
1 changed files with 10 additions and 1 deletions
|
@ -6,6 +6,7 @@ using NLog;
|
||||||
using NzbDrone.Common.Composition;
|
using NzbDrone.Common.Composition;
|
||||||
using NzbDrone.Common.Disk;
|
using NzbDrone.Common.Disk;
|
||||||
using NzbDrone.Common.EnvironmentInfo;
|
using NzbDrone.Common.EnvironmentInfo;
|
||||||
|
using NzbDrone.Common.Exceptions;
|
||||||
using NzbDrone.Common.Instrumentation;
|
using NzbDrone.Common.Instrumentation;
|
||||||
using NzbDrone.Core.Datastore.Migration.Framework;
|
using NzbDrone.Core.Datastore.Migration.Framework;
|
||||||
|
|
||||||
|
@ -127,6 +128,10 @@ namespace NzbDrone.Core.Datastore
|
||||||
|
|
||||||
throw new CorruptDatabaseException("Database file: {0} is corrupt, restore from backup if available. See: https://github.com/Lidarr/Lidarr/wiki/FAQ#i-am-getting-an-error-database-disk-image-is-malformed", e, fileName);
|
throw new CorruptDatabaseException("Database file: {0} is corrupt, restore from backup if available. See: https://github.com/Lidarr/Lidarr/wiki/FAQ#i-am-getting-an-error-database-disk-image-is-malformed", e, fileName);
|
||||||
}
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
throw new LidarrStartupException(e, "Error creating main database");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void CreateLog(string connectionString, MigrationContext migrationContext)
|
private void CreateLog(string connectionString, MigrationContext migrationContext)
|
||||||
|
@ -155,6 +160,10 @@ namespace NzbDrone.Core.Datastore
|
||||||
|
|
||||||
_migrationController.Migrate(connectionString, migrationContext);
|
_migrationController.Migrate(connectionString, migrationContext);
|
||||||
}
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
throw new LidarrStartupException(e, "Error creating log database");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue