fix: write to index only one time#2282
Conversation
WalkthroughRemoved index-writing blocks from runner/runner.go that previously appended per-response entries to main and screenshot index files. Core response processing, filtering, and storage logic remains unchanged. Control flow now skips persisting index entries, altering side effects and disk I/O during RunEnumeration. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
participant Caller
participant Runner
participant Storage as Storage (responses/screenshots)
participant Index as Index Files
Caller->>Runner: RunEnumeration()
loop For each response
Runner->>Runner: Apply filters
alt Should store response
Runner->>Storage: Save response/screenshot
note right of Runner: Index writes removed<br/>(no append to main/screenshot indexes)
Runner--x Index: (No operation)
else Skip storing
Runner-->>Runner: Continue
end
end
Runner-->>Caller: Return results
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
eaf6e9c to
ee3b2ab
Compare
Summary
If
-srdor-srflags is used, an index.txt file would be generated to store reponse file path, request URL, and it's response code. This happens 2 times for a single request, in which the first write doesn't even have the response path populated yet.Before
Proposed Changes
Summary by CodeRabbit
Refactor
Chores