Skip to content

Conversation

@yaguzmang
Copy link
Contributor

@yaguzmang yaguzmang commented Dec 30, 2025

TODO:

  • Move remaining files under worker/tasks/verifyLinks

Comment on lines +10 to +16
if (ProcessEnv.nodeEnv === NodeEnv.development) {
void import('./worker/tasks/verifyLinks/triggerVerifyLinksWorker')
.then(({ triggerVerifyLinksWorker }) => triggerVerifyLinksWorker())
.catch((error) => {
Logger.error(`[verifyLinks] failed to start local worker: ${JSON.stringify(error)}`)
})
}
Copy link
Contributor Author

@yaguzmang yaguzmang Dec 30, 2025

Choose a reason for hiding this comment

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

Starting the verify-links worker automatically so local dev env doesn’t get stuck in a stale state: the server restarts, the worker dies, but Redis still says a worker is “active”. When that happens, new verify requests won’t spin up a worker and the queue just sits there until you manually restart the worker or clear Redis.

We might need something similar for prod, we could use a watchdog mechanism that checks in an interval if there are queued jobs but no dyno worker. Though could be good to test first as it is to see if that's necessary at all.

Copy link
Member

Choose a reason for hiding this comment

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

why do we need this in server start ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

In dev we don’t have the same Heroku lifecycle (enqueue job → start dedicated dyno → dyno consumes queue), we run the worker in the same main process. So I'm starting it here so it cleans up any stale jobs that might happen because of server restarts during development.

Should we add a separate start.dev.ts maybe? what do you think?

@yaguzmang yaguzmang marked this pull request as ready for review December 31, 2025 21:47
@@ -0,0 +1,25 @@
import { LinkToVisit } from 'meta/cycleData/links/link'
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Moved this file from src/server/controller/cycleData/links/visitCycleLinks/utils/mergeLinks.ts. No logic changes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants