fix: allow large digital human uploads
This commit is contained in:
@@ -9,7 +9,7 @@ use crate::{
|
|||||||
};
|
};
|
||||||
use axum::{
|
use axum::{
|
||||||
body::Bytes,
|
body::Bytes,
|
||||||
extract::{Multipart, Path, Query, State},
|
extract::{DefaultBodyLimit, Multipart, Path, Query, State},
|
||||||
http::{header, HeaderMap, Method, StatusCode},
|
http::{header, HeaderMap, Method, StatusCode},
|
||||||
response::{IntoResponse, Response},
|
response::{IntoResponse, Response},
|
||||||
routing::{get, post},
|
routing::{get, post},
|
||||||
@@ -28,6 +28,7 @@ const TASK_TYPE_DIGITAL_HUMAN: &str = "digital-human-generation";
|
|||||||
const DIGITAL_HUMAN_TIMEOUT_SECS: u64 = 900;
|
const DIGITAL_HUMAN_TIMEOUT_SECS: u64 = 900;
|
||||||
const DIGITAL_HUMAN_POLL_INTERVAL_SECS: u64 = 5;
|
const DIGITAL_HUMAN_POLL_INTERVAL_SECS: u64 = 5;
|
||||||
const DIGITAL_HUMAN_MAX_POLLS: usize = 180;
|
const DIGITAL_HUMAN_MAX_POLLS: usize = 180;
|
||||||
|
const DIGITAL_HUMAN_UPLOAD_BODY_LIMIT_BYTES: usize = 256 * 1024 * 1024;
|
||||||
|
|
||||||
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
|
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
|
||||||
enum DigitalHumanEngine {
|
enum DigitalHumanEngine {
|
||||||
@@ -433,6 +434,7 @@ pub fn routes() -> Router<AppState> {
|
|||||||
"/api/digital-human/pixelle/files/{*path}",
|
"/api/digital-human/pixelle/files/{*path}",
|
||||||
get(pixelle_proxy_file),
|
get(pixelle_proxy_file),
|
||||||
)
|
)
|
||||||
|
.layer(DefaultBodyLimit::max(DIGITAL_HUMAN_UPLOAD_BODY_LIMIT_BYTES))
|
||||||
}
|
}
|
||||||
|
|
||||||
fn local_v1_base(state: &AppState) -> String {
|
fn local_v1_base(state: &AppState) -> String {
|
||||||
|
|||||||
Reference in New Issue
Block a user