Skip to content

Commit 41a851f

Browse files
committed
Added busy timeout fixes maxpiva#35 .
Misc quality fixes
1 parent ccc0fcf commit 41a851f

3 files changed

Lines changed: 3 additions & 1 deletion

File tree

KaizokuBackend/Migration/MigrationService.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ public async Task<bool> RunAsync(CancellationToken cancellationToken = default)
143143
newDatabasePath = Path.GetFullPath(newDatabasePath);
144144
if (!File.Exists(newDatabasePath))
145145
{
146-
_logger.LogError("No existing database found at {Path}. Assuming new installation.", newDatabasePath);
146+
_logger.LogInformation("No existing database found at {Path}. Assuming new installation.", newDatabasePath);
147147
var newDbOptions2 = new DbContextOptionsBuilder<AppDbContext>()
148148
.UseSqlite($"Data Source={newDatabasePath}")
149149
.UseQueryTrackingBehavior(QueryTrackingBehavior.TrackAll)

KaizokuBackend/Services/Background/StartupHostedService.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,7 @@ public async Task StartAsync(CancellationToken cancellationToken)
111111
AppDbContext db = scope.ServiceProvider.GetRequiredService<AppDbContext>();
112112
await db.Database.MigrateAsync(cancellationToken).ConfigureAwait(false);
113113
await db.Database.ExecuteSqlRawAsync("PRAGMA journal_mode=WAL;", cancellationToken).ConfigureAwait(false);
114+
await db.Database.ExecuteSqlRawAsync("PRAGMA busy_timeout=5000;", cancellationToken).ConfigureAwait(false);
114115
await _fixes.FixThumbnailsOfSeriesWithMissingThumbnailsAsync(cancellationToken).ConfigureAwait(false);
115116

116117
IHostApplicationLifetime lifetime = scope.ServiceProvider.GetRequiredService<IHostApplicationLifetime>();

Mihon.ExtensionsBridge.Net/Mihon.ExtensionsBridge.Core/Services/ExtensionManager.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -637,6 +637,7 @@ private async Task AcceptWorkUnitAsync(ExtensionWorkUnit workUnit, CancellationT
637637
//string destpdbFile = Path.ChangeExtension(Path.Combine(expectedFolder, workUnit.Entry.Icon.FileName), "pdb");
638638
string srcIconFile = Path.Combine(workUnit.WorkingFolder.Path, workUnit.Entry.Icon.FileName);
639639
string destIconFile = Path.Combine(expectedFolder, workUnit.Entry.Icon.FileName);
640+
GC.Collect();
640641
await MoveFileSafeAsync(srcApkFile, destApkFile,
641642
$"Failed to move APK file for extension {workUnit.Entry.Extension.Name} version {workUnit.Entry.Extension.Version} after multiple attempts. (File Copied)",
642643
5, token).ConfigureAwait(false);

0 commit comments

Comments
 (0)