templates/bill.html: кнопка Остановить расчет, серийный режим при ошибке, 3 попытки#16
Merged
Merged
Conversation
Adding .gitkeep for PR creation (default mode). This file will be removed when the task is complete. Issue: ideav#15
…v#15) - Adds a "Остановить расчет" button that halts ongoing processing and is shown only while processArtists is running. - After any error, maxConcurrent drops to 1 and is no longer restored to the initial value mid-run, so all subsequent and retry requests are serial while errors are occurring. - After an error, up to 3 retry attempts are performed (was 1), each with the existing 5-second delay; retries also honor the stop flag. - processWithLimit now reads the current maxConcurrent on each iteration so the post-error drop to 1 takes effect immediately.
Contributor
Author
Working session summaryPR is ready for review. Summary Implemented the three requirements from issue #15 in
Also added PR is now ready for review: #16 This summary was automatically extracted from the AI working session output. |
Contributor
Author
🤖 Solution Draft LogThis log file contains the complete execution trace of the AI solution draft process. 💰 Cost: $1.885220📊 Context and tokens usage:
Total: (4.3K new + 87.8K cache writes + 1.8M cache reads) input tokens, 16.2K output tokens, $1.885220 cost 🤖 Models used:
📎 Log file uploaded as Gist (1164KB)Now working session is ended, feel free to review and add any feedback on the solution draft. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #15
Three changes to
templates/bill.htmlrequested in the issue title:while
processArtistsis running. Clicking it setsstopRequested = true,which short-circuits the parallel loop, the per-artist task, and any
pending retry delay. The button hides automatically when processing
finishes (success, stop, or critical error).
encountered,
maxConcurrentdrops to 1 and is not restored to itsinitial value (
2) for the rest of the run, so every following request(retry or new artist) is serial while the system is unhealthy. The
previous behavior (introduced in Fix: Issue #9 - Make maxConcurrent variable and restore after retry #10) restored concurrency after a single
retry.
processWithLimitnow reads the currentmaxConcurrenton eachiteration so the drop takes effect immediately for the next artist.
isRetrybooleanwith a
retryCountcounter. The function recurses withretryCount + 1up to
maxRetries = 3, keeping the existing 5-second delay betweenattempts. After exhausting the 3 retries the error is propagated as
before.
Changes
templates/bill.html:#stopBilllink below the bill table.stopRequestedflag, reset tofalseat the start ofeach
processArtistsrun.processArtist(artist, retryCount = 0)with a 3-retry loop and stopchecks before/after the retry delay.
maxConcurrentis forced to 1 on the first error of a run and stays at1; the post-retry restoration is removed.
processWithLimitreads the closure variablemaxConcurrentperiteration instead of taking it as a parameter.
states and hides the Stop button in all of them.
experiments/test_issue15_logic.js: standalone Node script that asserts(a) up to 3 retries occur before an error is thrown, (b)
maxConcurrentbecomes 1 on the first failure and is never restored, and (c)
stopRequested = truehalts processing.Test plan
node experiments/test_issue15_logic.jspasses all 4 cases./billpage:label switches to "Остановлено пользователем" and no more requests fire.
with 5 s delays, then either succeeds or reports an error.
🤖 Generated with Claude Code