Skip to content

chore: remove unused TaskState weak-ref fields for create-batch and cascade-batch-state - #1706

Open
detail-app[bot] wants to merge 1 commit into
mainfrom
detail/dead-code/chore-remove-unused-taskstate-weak-ref-fields-for-f06900
Open

detail-app[bot] wants to merge 1 commit into
mainfrom
detail/dead-code/chore-remove-unused-taskstate-weak-ref-fields-for-f06900

Conversation

@detail-app

@detail-app detail-app Bot commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

Removed the dead TaskState::create_batch_job and TaskState::cascade_batch_state_job
weak-ref fields, their get_create_batch_job/get_cascade_batch_state_job getters,
the OnceLock::set writes in TaskRunner::new, and the corresponding initializers
across all TaskState { ... } construction sites (1 production + 6 test sites).

These weak-ref fields and getters had no production or test consumers. Production
enqueue paths reach into the strong Arc<Job> fields on TaskRunner directly
(state.task_runner.create_batch_job.enqueue(...) and
state.task_runner.cascade_batch_state_job), bypassing the weak-ref accessors
entirely. The cross-job enqueue pattern described in their doc comments was never
wired up.

This is a connected dead cluster: each field was read only by its getter, and each
getter had zero call-sites anywhere in the codebase.

History


Dead Code PRs can be configured here.

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Sep 8, 2026

Copy link
Copy Markdown

Deploying control-layer with  Cloudflare Pages  Cloudflare Pages

Latest commit: 38d4154
Status: ✅  Deploy successful!
Preview URL: https://d9b09248.control-layer.pages.dev
Branch Preview URL: https://detail-dead-code-chore-remov-h45f.control-layer.pages.dev

View logs

@detail-app
detail-app Bot requested a review from pjb157 September 8, 2026 06:48
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.

1 participant