mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[PR #4635] [MERGED] Skip idle NoodleR reserve scans and back off disabled Noodle refresh polls #6450
Labels
No labels
android
bug
bugfix
ci
client
code freeze pause
container
dependencies
docs
documentation
duplicate
enhancement
feature
feature
feature
feature-creep
fixed-in-refactor
fixed-in-staging
good first issue
help wanted
in-pr
in-pr
needs-codeowner-decision
normal-scope
old-codebase
old-codebase
pull-request
qol
question
refactor
regression
revisit later
roadmap
scope-risk
scope-risk
server
server
shared
soup
upstream
windows
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Pasta-Devs/Marinara-Engine#6450
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/4635
Author: @Gunterlie
Created: 8/5/2026
Status: ✅ Merged
Merged: 8/5/2026
Merged by: @Gunterlie
Base:
staging← Head:noodler-for-the-cpu-poor📝 Commits (3)
943b27eSkip idle NoodleR reserve scans and back off disabled refresh polls (#4630)b480e7bMerge branch 'staging' into noodler-for-the-cpu-poorab17dffUse an existence check for the idle reserve poll and cover the remaining idle-state combination📊 Changes
5 files changed (+33 additions, -2 deletions)
View changed files
📝
CHANGELOG.md(+1 -0)📝
packages/server/src/services/noodle/noodle-autopost-scheduler.service.ts(+14 -0)📝
packages/server/src/services/noodle/noodle-refresh-scheduler.service.ts(+4 -1)📝
packages/server/src/services/storage/noodle.storage.ts(+6 -0)📝
scripts/regressions/noodle-scheduler.regression.ts(+8 -1)📄 Description
Why
Two Noodle background schedulers wake every 60 seconds forever, even with the features disabled and nothing to do. On a phone/Termux install that is a permanent idle drain for no user-visible benefit (#4630, found during a mobile-battery investigation).
reconcileNoodlerReservebefore any settings check. That path full-scansnoodlerPreparedPostsandnoodlePostsandJSON.parses every post's metadata — O(all posts) per minute on the file-native store, with automatic posting off and zero prepared rows.refreshesPerDay === 0, so a disabled schedule still woke 1440 times a day to learn nothing changed.What changed
noodle-autopost-scheduler.service.ts: the periodicpoll()now reads settings first and returns early when automatic posting is disabled and there are no prepared reserve rows to tidy. The one cheap read it does (listNoodlerPreparedPosts) replaces both full table materializations. The startup reconcile stays unconditional, per the scheduler's own comment about upgrades beginning their hold while posting is disabled.noodle-refresh-scheduler.service.ts: a disabled schedule (refreshesPerDay === 0) now backs the poll off to 15 minutes instead of 60 seconds. Enabling the feature is noticed within one backoff window; nothing else changes about the retry/failure delays.noodlerReservePollIsIdleso the skip condition is directly assertable, and covered both behaviors innoodle-scheduler.regression.ts.Behavior when the features are enabled, or when prepared rows exist while disabled, is unchanged — reconciliation still runs so stale rows are still discarded.
Validation
pnpm checkpnpm regression:noodleRun locally: server
lint(tsc) passes;noodle-scheduler,noodle-autopost, andnoodle-refresh-transactionregressions pass. ClienteslintneedsNODE_OPTIONS=--max-old-space-size=8192in this sandbox (pre-existing OOM, unrelated to this change).Test plan
reconcileNoodlerPreparedPosts), and that the startup reconcile still runs once.Closes #4630.
Summary by CodeRabbit
Performance
Bug Fixes
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.