Fix incorrect method call in updateExpTextProcessingTime() #334
+1
−1
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.
This commit fixes a bug where the method updateExpTextProcessingTime incorrectly called getExpImgProcessingTime. The change ensures that text and image processing times are tracked independently.
Description
Fixes a bug in
updateExpTextProcessingTime()where it incorrectly callsgetExpImgProcessingTime()instead ofgetExpTextProcessingTime(). This causes database type conflicts when processing text generation tasks.The Bug
File:
lib/Service/OpenAiAPIService.phpLine: 850
The function reads image processing time configuration when it should read text processing time configuration:
This causes a mismatch between:
openai_image_generation_time/localai_image_generation_timeopenai_text_generation_time/localai_text_generation_timeImpact
Error Message
When it Occurs
Affected Versions
The Fix
Change line 850 to call the correct method:
public function updateExpTextProcessingTime(int $runtime): void { - $oldTime = floatval($this->getExpImgProcessingTime()); + $oldTime = floatval($this->getExpTextProcessingTime()); $newTime = (1.0 - Application::EXPECTED_RUNTIME_LOWPASS_FACTOR) * $oldTime + Application::EXPECTED_RUNTIME_LOWPASS_FACTOR * floatval($runtime);Root Cause
Copy-paste error when
updateExpTextProcessingTime()was created. The correspondingupdateExpImgProcessingTime()method (line 774) correctly callsgetExpImgProcessingTime(), but this pattern wasn't updated for the text processing variant.Testing
The fix ensures:
Reproduction
Stack Trace Context
Checklist