Skip to content

[Tech Debt] Fix misleading/stale comments across multiple files #269

@sonikro

Description

@sonikro

Problem

Several comments are incorrect or stale:

1. PendingServerCleanupRoutine.ts:6 — Wrong schedule comment

// Schedule a job to run every 10 minutes
schedule.scheduleJob('*/15 * * * *', ...);  // Actually every 15 minutes!

2. TerminatePendingServers.ts:66 — Stale Node.js polyfill comment

// Use a local AggregateError polyfill (for Node <15)
const error = new Error(`...`);
(error as any).errors = ...;

The project requires and runs on Node 24. AggregateError is natively available. The comment is misleading, and the code should use native AggregateError.

3. TerminatePendingServers.ts:67 — Log message says wrong threshold

eventMessage: `Server ${server.serverId} terminated after being stuck in pending for over 10 minutes.`

But the actual threshold check is:

if (pendingDuration >= 15 * 60 * 1000) { // 15 minutes

4. DefaultTaskDefinitionService.ts:89 — Stale TODO

// TODO: Remove logging to reduce cost

No owner, no ticket, no context. Either act on it or remove it.

Fix

  1. Fix comment in PendingServerCleanupRoutine.ts from "every 10 minutes" to "every 15 minutes"
  2. Remove the Node <15 polyfill comment from TerminatePendingServers.ts; use native AggregateError
  3. Fix the log message in TerminatePendingServers.ts to say "15 minutes" instead of "10 minutes"
  4. Remove the stale TODO comment from DefaultTaskDefinitionService.ts

Metadata

Metadata

Assignees

No one assigned

    Labels

    tech-debtTechnical debt items

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions