Skip to content

Commit

Permalink
format
Browse files Browse the repository at this point in the history
  • Loading branch information
adamhathcock committed Oct 22, 2024
1 parent 6b3305a commit e95600a
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ public void Report(ProgressArgs value)
}
else
{

_progressCallback(value);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,11 @@ public class ProgressDisplayManager(IStopwatchManager stopwatch) : IProgressDisp
public void Begin() => stopwatch.Start();

private long _lastCount;
public long LastCount { get => _lastCount; set => _lastCount = value; }
public long LastCount
{
get => _lastCount;
set => _lastCount = value;
}

public bool ShouldUpdate()
{
Expand Down Expand Up @@ -51,8 +55,8 @@ public string CalculateSpeed(ProgressArgs args)
return $"{ToFileSize(countPerSecond)} / sec";
case ProgressEvent.DeserializeObject:
case ProgressEvent.SerializeObject:
case ProgressEvent.DownloadObject:
case ProgressEvent.UploadObject:
case ProgressEvent.DownloadObject:
case ProgressEvent.UploadObject:
return $"{ThreeNonZeroDigits(countPerSecond)} objects / sec";
default:
return string.Empty;
Expand Down
24 changes: 11 additions & 13 deletions Sdk/Speckle.Connectors.Common/Operations/ReceiveOperation.cs
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,9 @@ CancellationToken cancellationToken

_progressDisplayManager.Begin();
Base? commitObject = await _operations
.Receive2(new Uri(account.serverInfo.url), receiveInfo.ProjectId,
.Receive2(
new Uri(account.serverInfo.url),
receiveInfo.ProjectId,
version.referencedObject,
account.token,
onProgressAction: new PassthroughProgress(args =>
Expand All @@ -71,26 +73,22 @@ CancellationToken cancellationToken
switch (args.ProgressEvent)
{
case ProgressEvent.CacheCheck:
case ProgressEvent.CacheCheck:
onOperationProgressed.Report(
new(
"Checking local cache",
_progressDisplayManager.CalculatePercentage(args)
)
new("Checking local cache", _progressDisplayManager.CalculatePercentage(args))
);
break;
case ProgressEvent.DownloadBytes:
case ProgressEvent.DownloadBytes:
onOperationProgressed.Report(new($"Downloading ({_progressDisplayManager.CalculateSpeed(args)})", null));
break;
case ProgressEvent.DownloadObject:
onOperationProgressed.Report(
new(
$"Downloading ({_progressDisplayManager.CalculateSpeed(args)})", null
$"Downloading Objects ({_progressDisplayManager.CalculateSpeed(args)})",
_progressDisplayManager.CalculatePercentage(args)
)
);
break;
case ProgressEvent.DownloadObject:
onOperationProgressed.Report(new(
$"Downloading Objects ({_progressDisplayManager.CalculateSpeed(args)})",
_progressDisplayManager.CalculatePercentage(args)));
break;
case ProgressEvent.DeserializeObject:
onOperationProgressed.Report(
new(
Expand Down

0 comments on commit e95600a

Please sign in to comment.