feat: allow users to specify timeout for text generations and workflows by environment variable (#8395)
This commit is contained in:
parent
032dd93b2f
commit
52857dc0a6
8 changed files with 34 additions and 4 deletions
|
|
@ -269,8 +269,10 @@ const Result: FC<IResultProps> = ({
|
|||
}))
|
||||
},
|
||||
onWorkflowFinished: ({ data }) => {
|
||||
if (isTimeout)
|
||||
if (isTimeout) {
|
||||
notify({ type: 'warning', message: t('appDebug.warningMessage.timeoutExceeded') })
|
||||
return
|
||||
}
|
||||
if (data.error) {
|
||||
notify({ type: 'error', message: data.error })
|
||||
setWorkflowProcessData(produce(getWorkflowProcessData()!, (draft) => {
|
||||
|
|
@ -326,8 +328,10 @@ const Result: FC<IResultProps> = ({
|
|||
setCompletionRes(res.join(''))
|
||||
},
|
||||
onCompleted: () => {
|
||||
if (isTimeout)
|
||||
if (isTimeout) {
|
||||
notify({ type: 'warning', message: t('appDebug.warningMessage.timeoutExceeded') })
|
||||
return
|
||||
}
|
||||
setRespondingFalse()
|
||||
setMessageId(tempMessageId)
|
||||
onCompleted(getCompletionRes(), taskId, true)
|
||||
|
|
@ -338,8 +342,10 @@ const Result: FC<IResultProps> = ({
|
|||
setCompletionRes(res.join(''))
|
||||
},
|
||||
onError() {
|
||||
if (isTimeout)
|
||||
if (isTimeout) {
|
||||
notify({ type: 'warning', message: t('appDebug.warningMessage.timeoutExceeded') })
|
||||
return
|
||||
}
|
||||
setRespondingFalse()
|
||||
onCompleted(getCompletionRes(), taskId, false)
|
||||
isEnd = true
|
||||
|
|
|
|||
|
|
@ -43,6 +43,7 @@ const LocaleLayout = ({
|
|||
data-public-sentry-dsn={process.env.NEXT_PUBLIC_SENTRY_DSN}
|
||||
data-public-maintenance-notice={process.env.NEXT_PUBLIC_MAINTENANCE_NOTICE}
|
||||
data-public-site-about={process.env.NEXT_PUBLIC_SITE_ABOUT}
|
||||
data-public-text-generation-timeout-ms={process.env.NEXT_PUBLIC_TEXT_GENERATION_TIMEOUT_MS}
|
||||
>
|
||||
<Topbar />
|
||||
<BrowserInitor>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue