Skip to content

Commit a21958d

Browse files
committed
chore: remove processing layer references from http lambda
1 parent 566f7ad commit a21958d

3 files changed

Lines changed: 7 additions & 53 deletions

File tree

cspell.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
"dotenvy",
1010
"dotenv",
1111
"onlyoffice",
12-
"dtolnay"
12+
"dtolnay",
13+
"poppler"
1314
]
1415
}

lambdas/http/src/main.rs

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,6 @@ use docbox_core::{
88
tenant::tenant_cache::TenantCache,
99
};
1010
use docbox_database::{DatabasePoolCache, DatabasePoolCacheConfig};
11-
use docbox_processing::{
12-
ProcessingLayer, ProcessingLayerConfig,
13-
office::{OfficeConverter, OfficeConverterConfig, OfficeProcessingLayer},
14-
};
1511
use docbox_search::{SearchIndexFactory, SearchIndexFactoryConfig};
1612
use docbox_secrets::{SecretManager, SecretsManagerConfig};
1713
use docbox_storage::{StorageLayerFactory, StorageLayerFactoryConfig};
@@ -52,19 +48,6 @@ async fn app() -> Result<Router, Box<dyn std::error::Error + Send + Sync>> {
5248
Err(_) => 100 * 1000 * 1024,
5349
};
5450

55-
// Create the converter
56-
let converter_config = OfficeConverterConfig::from_env();
57-
let converter = OfficeConverter::from_config(converter_config)?;
58-
59-
// Load the config for the processing layer
60-
let processing_layer_config = ProcessingLayerConfig::from_env()?;
61-
62-
// Setup processing layer
63-
let processing = ProcessingLayer {
64-
office: OfficeProcessingLayer { converter },
65-
config: processing_layer_config,
66-
};
67-
6851
// Create website scraping service
6952
let website_meta_service_config = WebsiteMetaServiceConfig::from_env()?;
7053
let website_meta_service = Arc::new(WebsiteMetaService::from_config(
@@ -116,7 +99,6 @@ async fn app() -> Result<Router, Box<dyn std::error::Error + Send + Sync>> {
11699
.layer(Extension(db_cache.clone()))
117100
.layer(Extension(website_meta_service))
118101
.layer(Extension(events))
119-
.layer(Extension(processing))
120102
.layer(Extension(tenant_cache))
121103
.layer(Extension(MaxFileSizeBytes(max_file_size_bytes)))
122104
.layer(TraceLayer::new_for_http());

lambdas/http/src/routes/admin.rs

Lines changed: 5 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
33
use crate::{
44
error::{HttpCommonError, HttpErrorResponse, HttpResult, HttpStatusResult},
5-
middleware::tenant::{TenantDb, TenantParams, TenantSearch, TenantStorage},
5+
middleware::tenant::{TenantDb, TenantParams, TenantSearch},
66
models::admin::{TenantDocumentBoxesRequest, TenantDocumentBoxesResponse, TenantStatsResponse},
77
};
88
use axum::{Extension, Json, http::StatusCode};
@@ -242,26 +242,8 @@ pub async fn search_tenant(
242242
params(TenantParams)
243243
)]
244244
#[tracing::instrument(skip_all)]
245-
pub async fn reprocess_octet_stream_files_tenant(
246-
TenantDb(_db): TenantDb,
247-
TenantSearch(_search): TenantSearch,
248-
TenantStorage(_storage): TenantStorage,
249-
// Extension(processing): Extension<ProcessingLayer>,
250-
) -> HttpStatusResult {
251-
// TODO: This is a heavy and long running operation, should be moved to client side only
252-
// docbox_core::files::reprocess_octet_stream_files::reprocess_octet_stream_files(
253-
// &db,
254-
// &search,
255-
// &storage,
256-
// &processing,
257-
// )
258-
// .await
259-
// .map_err(|error| {
260-
// tracing::error!(?error, "failed to reprocess octet-stream files");
261-
// HttpCommonError::ServerError
262-
// })?;
263-
264-
Ok(StatusCode::NO_CONTENT)
245+
pub async fn reprocess_octet_stream_files_tenant() -> HttpStatusResult {
246+
Err(HttpCommonError::Unsupported.into())
265247
}
266248

267249
/// Rebuild search index
@@ -280,19 +262,8 @@ pub async fn reprocess_octet_stream_files_tenant(
280262
params(TenantParams)
281263
)]
282264
#[tracing::instrument(skip_all)]
283-
pub async fn rebuild_search_index_tenant(// TenantDb(db): TenantDb,
284-
// TenantSearch(search): TenantSearch,
285-
// TenantStorage(storage): TenantStorage,
286-
) -> HttpStatusResult {
287-
// TODO: This is a heavy and long running operation, should be moved to client side only
288-
// docbox_core::tenant::rebuild_tenant_index::rebuild_tenant_index(&db, &search, &storage)
289-
// .await
290-
// .map_err(|error| {
291-
// tracing::error!(?error, "failed to rebuilt tenant search index");
292-
// HttpCommonError::ServerError
293-
// })?;
294-
295-
Ok(StatusCode::NO_CONTENT)
265+
pub async fn rebuild_search_index_tenant() -> HttpStatusResult {
266+
Err(HttpCommonError::Unsupported.into())
296267
}
297268

298269
/// Flush database cache

0 commit comments

Comments
 (0)