Compare commits

...

2 Commits

Author SHA1 Message Date
Adam Hathcock 637997bd18 Report progress before saving SQLite
.NET Build and Publish / build (push) Has been cancelled
2025-08-26 10:31:43 +01:00
Adam Hathcock 6c89748fd0 Report increment rather than total position 2025-08-26 10:04:14 +01:00
5 changed files with 7 additions and 8 deletions
+2 -2
View File
@@ -3,11 +3,11 @@
"isRoot": true, "isRoot": true,
"tools": { "tools": {
"csharpier": { "csharpier": {
"version": "1.0.2", "version": "1.1.2",
"commands": [ "commands": [
"csharpier" "csharpier"
], ],
"rollForward": false "rollForward": false
} }
} }
} }
+1 -2
View File
@@ -169,8 +169,7 @@ public class Base : DynamicBase, ISpeckleObject
return count; return count;
} }
case IEnumerable e case IEnumerable e and not string:
and not string:
{ {
foreach (var arrValue in e) foreach (var arrValue in e)
{ {
@@ -100,9 +100,9 @@ public sealed class ObjectSaver(
{ {
if (!_options.SkipCacheWrite && batch.Count != 0) if (!_options.SkipCacheWrite && batch.Count != 0)
{ {
sqLiteJsonCacheManager.SaveObjects(batch.Select(x => (x.Id.Value, x.Json.Value)));
Interlocked.Add(ref _cached, batch.Count); Interlocked.Add(ref _cached, batch.Count);
progress?.Report(new(ProgressEvent.CachedToLocal, _cached, _objectsSerialized)); progress?.Report(new(ProgressEvent.CachedToLocal, _cached, _objectsSerialized));
sqLiteJsonCacheManager.SaveObjects(batch.Select(x => (x.Id.Value, x.Json.Value)));
} }
} }
catch (OperationCanceledException) catch (OperationCanceledException)
@@ -20,7 +20,7 @@ internal sealed class ProgressStream(
{ {
int n = _stream.Read(buffer, offset, count); int n = _stream.Read(buffer, offset, count);
_position += n; _position += n;
progress?.Report(new(ProgressEvent.DownloadBytes, _position, streamLength)); progress?.Report(new(ProgressEvent.DownloadBytes, n, streamLength));
return n; return n;
} }
@@ -28,7 +28,7 @@ internal sealed class ProgressStream(
{ {
_stream.Write(buffer, offset, count); _stream.Write(buffer, offset, count);
_position += count; _position += count;
progress?.Report(new(ProgressEvent.UploadBytes, _position, streamLength)); progress?.Report(new(ProgressEvent.UploadBytes, count, streamLength));
} }
public override bool CanRead => true; public override bool CanRead => true;
@@ -39,7 +39,7 @@ public abstract class PrimitiveTestFixture
}.Select(x => new object[] { x }); }.Select(x => new object[] { x });
public static Half[] Float16TestCases { get; } = public static Half[] Float16TestCases { get; } =
[default, Half.Epsilon, Half.MaxValue, Half.MinValue, Half.PositiveInfinity, Half.NegativeInfinity, Half.NaN]; [default, Half.Epsilon, Half.MaxValue, Half.MinValue, Half.PositiveInfinity, Half.NegativeInfinity, Half.NaN];
public static float[] FloatIntegralTestCases { get; } = [0, 1, int.MaxValue, int.MinValue]; public static float[] FloatIntegralTestCases { get; } = [0, 1, int.MaxValue, int.MinValue];