Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion src/lib/core/streamr/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,14 @@ export default class implements Hooks {
await new Promise((resolve) => setTimeout(resolve, 2000));
} catch (error) {
console.error(`[streamr] Error publishing to Streamr:`, error);
throw error;
} finally {
// destroy the client to free resources
await streamrClient.destroy();
try {
await streamrClient.destroy();
} catch (destroyError) {
console.error(`[streamr] Error destroying client:`, destroyError);
}
}
}
}
7 changes: 6 additions & 1 deletion src/lib/core/streamr/ui.ts
Original file line number Diff line number Diff line change
Expand Up @@ -147,8 +147,13 @@ export default class implements UIHooks {
console.log(`[streamr-ui] Published ${pendingTransactions.length} transactions to stream ${streamId}`);
} catch (error) {
console.error(`[streamr-ui] Error publishing to Streamr:`, error);
throw error;
} finally {
await streamrClient.destroy();
try {
await streamrClient.destroy();
} catch (destroyError) {
console.error(`[streamr-ui] Error destroying client:`, destroyError);
}
}
}
}