add more disposal

This commit is contained in:
Adam Hathcock
2024-12-20 10:01:30 +00:00
parent 1b84c6cea7
commit cf0dfe8ef8
7 changed files with 44 additions and 44 deletions
@@ -1,5 +1,4 @@
using System.Collections.Concurrent;
using System.Text;
using Speckle.InterfaceGenerator;
using Speckle.Sdk.Common;
using Speckle.Sdk.Dependencies;
@@ -25,24 +24,9 @@ public readonly record struct SerializeProcessResults(
IReadOnlyDictionary<Id, ObjectReference> ConvertedReferences
);
public readonly record struct BaseItem(Id Id, Json Json, bool NeedsStorage, Closures? Closures) : IHasSize
{
public int Size { get; } = Encoding.UTF8.GetByteCount(Json.Value);
public bool Equals(BaseItem? other)
{
if (other is null)
{
return false;
}
return string.Equals(Id.Value, other.Value.Id.Value, StringComparison.OrdinalIgnoreCase);
}
public override int GetHashCode() => Id.GetHashCode();
}
public partial interface ISerializeProcess : IDisposable;
[GenerateAutoInterface]
public class SerializeProcess(
public sealed class SerializeProcess(
IProgress<ProgressArgs>? progress,
ISqLiteJsonCacheManager sqLiteJsonCacheManager,
IServerObjectManager serverObjectManager,
@@ -64,6 +48,8 @@ public class SerializeProcess(
private long _uploaded;
private long _cached;
[AutoInterfaceIgnore]
public void Dispose() => sqLiteJsonCacheManager.Dispose();
public async Task<SerializeProcessResults> Serialize(Base root, CancellationToken cancellationToken)
{