Skip to content
Open
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
12 changes: 12 additions & 0 deletions ot-node.js
Original file line number Diff line number Diff line change
Expand Up @@ -442,6 +442,18 @@ class OTNode {

async handleExit() {
this.logger.info('SIGINT or SIGTERM received. Shutting down...');

// Cleanup telemetry first to ensure all events are sent
try {
const telemetryModuleManager = this.container.resolve('telemetryModuleManager');
if (telemetryModuleManager && telemetryModuleManager.getImplementation()) {
this.logger.info('Cleaning up telemetry...');
await telemetryModuleManager.getImplementation().module.cleanup();
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: Telemetry Cleanup Method Access Error

The telemetry cleanup call in handleExit incorrectly attempts to access telemetryModuleManager.getImplementation().module.cleanup(). The cleanup() method is directly available on the object returned by getImplementation(), not nested under a .module property, which will cause a runtime error.

Locations (1)

Fix in Cursor Fix in Web

}
} catch (error) {
this.logger.error(`Error during telemetry cleanup: ${error.message}`);
}

const commandExecutor = this.container.resolve('commandExecutor');
await commandExecutor.commandExecutorShutdown();
process.exit(0);
Expand Down
Loading
Loading