feat(VocabService, AppHeader): enhance timeout configuration and update ad display settings
All checks were successful
Deploy to production / deploy (push) Successful in 2m21s
All checks were successful
Deploy to production / deploy (push) Successful in 2m21s
- Updated the VocabService to allow configurable timeout for responses, defaulting to 300 seconds if not set or invalid. - Modified AppHeader component to change ad format to horizontal and adjusted responsive settings for better display consistency. - Ensured proper height settings for ad elements to maintain layout integrity across different screen sizes.
This commit is contained in:
@@ -2844,7 +2844,11 @@ export default class VocabService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const controller = new AbortController();
|
const controller = new AbortController();
|
||||||
const timeout = setTimeout(() => controller.abort(), 120000);
|
const configuredTimeout = Number(process.env.LLM_ASSISTANT_TIMEOUT_MS);
|
||||||
|
const timeoutMs = Number.isFinite(configuredTimeout) && configuredTimeout >= 30000
|
||||||
|
? configuredTimeout
|
||||||
|
: 300000;
|
||||||
|
const timeout = setTimeout(() => controller.abort(), timeoutMs);
|
||||||
|
|
||||||
const temperatureByMode = {
|
const temperatureByMode = {
|
||||||
explain: 0.4,
|
explain: 0.4,
|
||||||
@@ -2878,7 +2882,7 @@ export default class VocabService {
|
|||||||
} catch (error) {
|
} catch (error) {
|
||||||
const err = new Error(
|
const err = new Error(
|
||||||
error?.name === 'AbortError'
|
error?.name === 'AbortError'
|
||||||
? 'Der Sprachassistent hat länger als zwei Minuten für eine Antwort gebraucht.'
|
? 'Der Sprachassistent hat das Antwort-Zeitlimit überschritten.'
|
||||||
: 'Der Sprachassistent konnte nicht erreicht werden.'
|
: 'Der Sprachassistent konnte nicht erreicht werden.'
|
||||||
);
|
);
|
||||||
err.status = 502;
|
err.status = 502;
|
||||||
|
|||||||
@@ -14,8 +14,8 @@
|
|||||||
style="display:block"
|
style="display:block"
|
||||||
data-ad-client="ca-pub-1104166651501135"
|
data-ad-client="ca-pub-1104166651501135"
|
||||||
:data-ad-slot="adSlotId"
|
:data-ad-slot="adSlotId"
|
||||||
data-ad-format="auto"
|
data-ad-format="horizontal"
|
||||||
data-full-width-responsive="true"
|
data-full-width-responsive="false"
|
||||||
></ins>
|
></ins>
|
||||||
</div>
|
</div>
|
||||||
<div class="header-meta">
|
<div class="header-meta">
|
||||||
@@ -255,10 +255,25 @@ export default {
|
|||||||
flex: 1 1 260px;
|
flex: 1 1 260px;
|
||||||
min-width: 180px;
|
min-width: 180px;
|
||||||
max-width: 560px;
|
max-width: 560px;
|
||||||
|
min-height: 54px;
|
||||||
|
max-height: 54px;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
overflow: hidden;
|
||||||
}
|
}
|
||||||
|
|
||||||
.header-ad .adsbygoogle {
|
.header-ad .adsbygoogle {
|
||||||
min-height: 54px;
|
width: 100% !important;
|
||||||
|
height: 54px !important;
|
||||||
|
min-height: 54px !important;
|
||||||
|
max-height: 54px !important;
|
||||||
|
overflow: hidden !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.header-ad :deep(iframe),
|
||||||
|
.header-ad :deep([id^="aswift_"]) {
|
||||||
|
height: 54px !important;
|
||||||
|
max-height: 54px !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
.header-meta__context {
|
.header-meta__context {
|
||||||
@@ -394,6 +409,20 @@ export default {
|
|||||||
width: 100%;
|
width: 100%;
|
||||||
max-width: none;
|
max-width: none;
|
||||||
flex: 1 1 100%;
|
flex: 1 1 100%;
|
||||||
|
min-height: 44px;
|
||||||
|
max-height: 44px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.header-ad .adsbygoogle {
|
||||||
|
height: 44px !important;
|
||||||
|
min-height: 44px !important;
|
||||||
|
max-height: 44px !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.header-ad :deep(iframe),
|
||||||
|
.header-ad :deep([id^="aswift_"]) {
|
||||||
|
height: 44px !important;
|
||||||
|
max-height: 44px !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
.header-meta {
|
.header-meta {
|
||||||
|
|||||||
Reference in New Issue
Block a user