(maxAge: number = 3600000)
| 729 | |
| 730 | // Keep this as backup for orphaned instances |
| 731 | static cleanup(maxAge: number = 3600000): void { |
| 732 | const now = Date.now() |
| 733 | for (const [chatId, instance] of AnalyticHandler.instances) { |
| 734 | if (now - instance.createdAt > maxAge) { |
| 735 | AnalyticHandler.resetInstance(chatId) |
| 736 | } |
| 737 | } |
| 738 | } |
| 739 | |
| 740 | /** |
| 741 | * Helper method to end an OpenTelemetry span with output, token usage, and model name attributes. |
nothing calls this directly
no test coverage detected