Skip to content

Commit 3b4f033

Browse files
Update recv.js
1 parent 004446d commit 3b4f033

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/commands/recv.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -160,9 +160,10 @@ export async function run(outDir, opts, ctx = {}) {
160160
await sink.close();
161161
await waitForPeerClose(rtc, 1500);
162162

163-
const completedAt = Date.now();
163+
const completedAt = Date.now();
164164
const durationMs = startedAt != null ? Math.max(0, completedAt - startedAt) : 0;
165165
const throughputStr = humanThroughput(written, durationMs);
166+
const stats = sink.getStats?.() || {};
166167
const announced = Number.isFinite(stats.announced) ? stats.announced : null;
167168
let announcedValue = "—";
168169
if (announced != null) {
@@ -199,8 +200,6 @@ export async function run(outDir, opts, ctx = {}) {
199200
});
200201
process.stderr.write(summary + "\n");
201202
// Return a structured result for programmatic use
202-
203-
const stats = sink.getStats?.() || {};
204203
return {
205204
bytesWritten: written,
206205
announcedBytes: stats.announced ?? 0,

0 commit comments

Comments
 (0)