Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/Migration/Version030102Date20241003155512.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public function postSchemaChange(IOutput $output, Closure $schemaClosure, array
$value = $this->appConfig->getValueString(Application::APP_ID, $key);
if ($value !== '') {
$encryptedValue = $this->crypto->encrypt($value);
$this->appConfig->setValueString(Application::APP_ID, $key, $encryptedValue);
$this->appConfig->setValueString(Application::APP_ID, $key, $encryptedValue, lazy: true);
}
}

Expand Down
2 changes: 1 addition & 1 deletion lib/Migration/Version030103Date20241009172829.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public function postSchemaChange(IOutput $output, Closure $schemaClosure, array
$value = $this->appConfig->getValueString(Application::APP_ID, $key);
if ($value !== '') {
$decryptedValue = $this->crypto->decrypt($value);
$this->appConfig->setValueString(Application::APP_ID, $key, $decryptedValue, false, true);
$this->appConfig->setValueString(Application::APP_ID, $key, $decryptedValue, true, true);
}
}
}
Expand Down
18 changes: 9 additions & 9 deletions lib/Service/OpenAiAPIService.php
Original file line number Diff line number Diff line change
Expand Up @@ -647,7 +647,7 @@ public function createChatCompletion(
* @return array|null
*/
private function getAdminExtraParams(string $configKey): ?array {
$stringValue = $this->appConfig->getValueString(Application::APP_ID, $configKey);
$stringValue = $this->appConfig->getValueString(Application::APP_ID, $configKey, lazy: true);
if ($stringValue === '') {
return null;
}
Expand Down Expand Up @@ -861,8 +861,8 @@ public function requestSpeechCreation(
*/
public function getExpTextProcessingTime(): int {
return $this->isUsingOpenAi()
? intval($this->appConfig->getValueString(Application::APP_ID, 'openai_text_generation_time', strval(Application::DEFAULT_OPENAI_TEXT_GENERATION_TIME)))
: intval($this->appConfig->getValueString(Application::APP_ID, 'localai_text_generation_time', strval(Application::DEFAULT_LOCALAI_TEXT_GENERATION_TIME)));
? intval($this->appConfig->getValueString(Application::APP_ID, 'openai_text_generation_time', strval(Application::DEFAULT_OPENAI_TEXT_GENERATION_TIME), lazy: true))
: intval($this->appConfig->getValueString(Application::APP_ID, 'localai_text_generation_time', strval(Application::DEFAULT_LOCALAI_TEXT_GENERATION_TIME), lazy: true));
}

/**
Expand All @@ -874,9 +874,9 @@ public function updateExpTextProcessingTime(int $runtime): void {
$newTime = (1.0 - Application::EXPECTED_RUNTIME_LOWPASS_FACTOR) * $oldTime + Application::EXPECTED_RUNTIME_LOWPASS_FACTOR * floatval($runtime);

if ($this->isUsingOpenAi()) {
$this->appConfig->setValueString(Application::APP_ID, 'openai_text_generation_time', strval(intval($newTime)));
$this->appConfig->setValueString(Application::APP_ID, 'openai_text_generation_time', strval(intval($newTime)), lazy: true);
} else {
$this->appConfig->setValueString(Application::APP_ID, 'localai_text_generation_time', strval(intval($newTime)));
$this->appConfig->setValueString(Application::APP_ID, 'localai_text_generation_time', strval(intval($newTime)), lazy: true);
}
}

Expand All @@ -885,8 +885,8 @@ public function updateExpTextProcessingTime(int $runtime): void {
*/
public function getExpImgProcessingTime(): int {
return $this->isUsingOpenAi()
? intval($this->appConfig->getValueString(Application::APP_ID, 'openai_image_generation_time', strval(Application::DEFAULT_OPENAI_IMAGE_GENERATION_TIME)))
: intval($this->appConfig->getValueString(Application::APP_ID, 'localai_image_generation_time', strval(Application::DEFAULT_LOCALAI_IMAGE_GENERATION_TIME)));
? intval($this->appConfig->getValueString(Application::APP_ID, 'openai_image_generation_time', strval(Application::DEFAULT_OPENAI_IMAGE_GENERATION_TIME), lazy: true))
: intval($this->appConfig->getValueString(Application::APP_ID, 'localai_image_generation_time', strval(Application::DEFAULT_LOCALAI_IMAGE_GENERATION_TIME), lazy: true));
}

/**
Expand All @@ -898,9 +898,9 @@ public function updateExpImgProcessingTime(int $runtime): void {
$newTime = (1.0 - Application::EXPECTED_RUNTIME_LOWPASS_FACTOR) * $oldTime + Application::EXPECTED_RUNTIME_LOWPASS_FACTOR * floatval($runtime);

if ($this->isUsingOpenAi()) {
$this->appConfig->setValueString(Application::APP_ID, 'openai_image_generation_time', strval(intval($newTime)));
$this->appConfig->setValueString(Application::APP_ID, 'openai_image_generation_time', strval(intval($newTime)), lazy: true);
} else {
$this->appConfig->setValueString(Application::APP_ID, 'localai_image_generation_time', strval(intval($newTime)));
$this->appConfig->setValueString(Application::APP_ID, 'localai_image_generation_time', strval(intval($newTime)), lazy: true);
}
}

Expand Down
Loading
Loading