mirror of
https://github.com/QuantumNous/new-api.git
synced 2026-03-29 23:10:35 +00:00
- Added TaskTimeoutMinutes constant to configure the timeout duration for asynchronous tasks. - Implemented sweepTimedOutTasks function to identify and handle unfinished tasks that exceed the timeout limit, marking them as failed and processing refunds if applicable. - Enhanced task polling loop to include the new timeout handling logic, ensuring timely cleanup of stale tasks.
27 lines
775 B
Go
27 lines
775 B
Go
package constant
|
|
|
|
var StreamingTimeout int
|
|
var DifyDebug bool
|
|
var MaxFileDownloadMB int
|
|
var StreamScannerMaxBufferMB int
|
|
var ForceStreamOption bool
|
|
var CountToken bool
|
|
var GetMediaToken bool
|
|
var GetMediaTokenNotStream bool
|
|
var UpdateTask bool
|
|
var MaxRequestBodyMB int
|
|
var AzureDefaultAPIVersion string
|
|
var NotifyLimitCount int
|
|
var NotificationLimitDurationMinute int
|
|
var GenerateDefaultToken bool
|
|
var ErrorLogEnabled bool
|
|
var TaskQueryLimit int
|
|
var TaskTimeoutMinutes int
|
|
|
|
// temporary variable for sora patch, will be removed in future
|
|
var TaskPricePatches []string
|
|
|
|
// TrustedRedirectDomains is a list of trusted domains for redirect URL validation.
|
|
// Domains support subdomain matching (e.g., "example.com" matches "sub.example.com").
|
|
var TrustedRedirectDomains []string
|