mirror of
https://github.com/fluxerapp/fluxer
synced 2026-10-18 13:35:42 +09:00
fix(app-proxy): remove the SPA document render reservation (#2447)
This commit is contained in:
1 parent
bc7f701e87
commit
7bd0d3a962
2 files changed
+3
-50
No files matched your search
@@ -13,19 +13,11 @@ use tokio::sync::Semaphore;
|
||||
pub const MAX_SPA_INDEX_BYTES: usize = 4 * 1024 * 1024;
|
||||
pub const MAX_RENDERED_SPA_INDEX_BYTES: usize = 8 * 1024 * 1024;
|
||||
pub const MAX_STATIC_TEXT_FILE_BYTES: usize = 4 * 1024 * 1024;
|
||||
pub const SPA_DOCUMENT_MEMORY_BUDGET_BYTES: usize = 160 * 1024 * 1024;
|
||||
pub const SPA_DOCUMENT_RENDER_RESERVATION_BYTES: u32 = 40 * 1024 * 1024;
|
||||
pub const UPSTREAM_ASSET_RESPONSES_IN_FLIGHT_MAX: usize = 32;
|
||||
pub const LOCAL_FILE_READS_IN_FLIGHT_MAX: usize = 256;
|
||||
|
||||
const _: () = assert!(
|
||||
MAX_RENDERED_SPA_INDEX_BYTES <= SPA_DOCUMENT_RENDER_RESERVATION_BYTES as usize,
|
||||
"a rendered SPA document must fit inside the memory reserved to render it"
|
||||
);
|
||||
|
||||
#[derive(Clone)]
|
||||
pub struct AppProxyBudgets {
|
||||
pub spa_document_memory: Arc<Semaphore>,
|
||||
pub upstream_asset_slots: Arc<Semaphore>,
|
||||
pub local_read_slots: Arc<Semaphore>,
|
||||
}
|
||||
@@ -33,7 +25,6 @@ pub struct AppProxyBudgets {
|
||||
impl AppProxyBudgets {
|
||||
pub fn new() -> Self {
|
||||
Self {
|
||||
spa_document_memory: Arc::new(Semaphore::new(SPA_DOCUMENT_MEMORY_BUDGET_BYTES)),
|
||||
upstream_asset_slots: Arc::new(Semaphore::new(UPSTREAM_ASSET_RESPONSES_IN_FLIGHT_MAX)),
|
||||
local_read_slots: Arc::new(Semaphore::new(LOCAL_FILE_READS_IN_FLIGHT_MAX)),
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user