perf(export): run export cores on the blocking pool

This commit is contained in:
t8y2 committed 2026-08-31 09:58:45 +08:00
1 parent 8e2e8c1b8c
commit d1046d54f9
8 files changed
+108 -6

No files matched your search

+3 -1
View File
@@ -67,7 +67,9 @@ pub async fn start_database_export(
let cancelled = Arc::new(AtomicBool::new(false));
let cancelled_progress = cancelled.clone();
tokio::spawn(async move {
// Exports interleave async fetches with synchronous row formatting and
// buffered disk writes; run them off the async workers (see spawn_export_task).
dbx_core::export_runtime::spawn_export_task(async move {
let result = database_export::export_database_sql_core(&app, &req, |progress| {
if matches!(progress.status, ExportStatus::Cancelled) {
cancelled_progress.store(true, Ordering::SeqCst);
@@ -69,7 +69,9 @@ pub async fn start_query_result_export(
let cancelled = Arc::new(AtomicBool::new(false));
let cancelled_progress = cancelled.clone();
tokio::spawn(async move {
// Exports interleave async fetches with synchronous row formatting and
// buffered disk writes; run them off the async workers (see spawn_export_task).
dbx_core::export_runtime::spawn_export_task(async move {
let execution_id = req.execution_id.clone().filter(|id| !id.trim().is_empty());
let registered_query = execution_id.as_ref().map(|id| {
app.running_queries.register_task(
+3 -1
View File
@@ -71,7 +71,9 @@ pub async fn start_table_export(
let cancelled = Arc::new(AtomicBool::new(false));
let cancelled_progress = cancelled.clone();
tokio::spawn(async move {
// Exports interleave async fetches with synchronous row formatting and
// buffered disk writes; run them off the async workers (see spawn_export_task).
dbx_core::export_runtime::spawn_export_task(async move {
let result = table_export::export_table_data_core(&app, &req, |progress| {
if matches!(progress.status, ExportStatus::Cancelled) {
cancelled_progress.store(true, Ordering::SeqCst);