Fixed claimed waifu decay that was introduced in a recent patch.
Cleaned up a little bit in marmalade loading. Clean marmalade unloading will be broken for a while probably
This commit is contained in:
parent
4659da224b
commit
4afa604a1b
2 changed files with 27 additions and 15 deletions
|
@ -577,7 +577,7 @@ public class WaifuService : IEService, IReadyExecutor
|
||||||
{
|
{
|
||||||
await using var uow = _db.GetDbContext();
|
await using var uow = _db.GetDbContext();
|
||||||
await uow.GetTable<WaifuInfo>()
|
await uow.GetTable<WaifuInfo>()
|
||||||
.Where(x => x.Price > minPrice && x.ClaimerId == null)
|
.Where(x => x.Price > minPrice && x.ClaimerId != null)
|
||||||
.UpdateAsync(old => new()
|
.UpdateAsync(old => new()
|
||||||
{
|
{
|
||||||
Price = (long)(old.Price * claimedMulti)
|
Price = (long)(old.Price * claimedMulti)
|
||||||
|
|
|
@ -250,6 +250,7 @@ public sealed class MarmaladeLoaderService : IMarmaladeLoaderService, IReadyExec
|
||||||
}
|
}
|
||||||
catch (Exception ex) when (ex is FileNotFoundException or BadImageFormatException)
|
catch (Exception ex) when (ex is FileNotFoundException or BadImageFormatException)
|
||||||
{
|
{
|
||||||
|
Log.Error(ex, "An error occurred loading a marmalade");
|
||||||
return MarmaladeLoadResult.NotFound;
|
return MarmaladeLoadResult.NotFound;
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
|
@ -334,7 +335,10 @@ public sealed class MarmaladeLoaderService : IMarmaladeLoaderService, IReadyExec
|
||||||
var a = ctx.LoadFromAssemblyPath(Path.GetFullPath(path));
|
var a = ctx.LoadFromAssemblyPath(Path.GetFullPath(path));
|
||||||
// ctx.LoadDependencies(a);
|
// ctx.LoadDependencies(a);
|
||||||
|
|
||||||
|
iocModule = null;
|
||||||
// load services
|
// load services
|
||||||
|
try
|
||||||
|
{
|
||||||
iocModule = new MarmaladeNinjectIocModule(_cont, a, safeName);
|
iocModule = new MarmaladeNinjectIocModule(_cont, a, safeName);
|
||||||
iocModule.Load();
|
iocModule.Load();
|
||||||
|
|
||||||
|
@ -344,6 +348,7 @@ public sealed class MarmaladeLoaderService : IMarmaladeLoaderService, IReadyExec
|
||||||
if (sis.Count == 0)
|
if (sis.Count == 0)
|
||||||
{
|
{
|
||||||
iocModule.Unload();
|
iocModule.Unload();
|
||||||
|
ctx.Unload();
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -352,6 +357,13 @@ public sealed class MarmaladeLoaderService : IMarmaladeLoaderService, IReadyExec
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
catch
|
||||||
|
{
|
||||||
|
iocModule?.Unload();
|
||||||
|
ctx.Unload();
|
||||||
|
throw;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private static readonly Type _paramParserType = typeof(ParamParser<>);
|
private static readonly Type _paramParserType = typeof(ParamParser<>);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue