fix: update imports and correct stream type
Co-authored-by: aider (openai/andrew/openrouter/deepseek/deepseek-chat-v3.1) <aider@aider.chat>
This commit is contained in:
@@ -3,9 +3,11 @@ use crate::services::item_service::ItemService;
|
|||||||
use crate::services::types::{ItemWithContent, ItemWithMeta};
|
use crate::services::types::{ItemWithContent, ItemWithMeta};
|
||||||
use rusqlite::Connection;
|
use rusqlite::Connection;
|
||||||
use std::collections::HashMap;
|
use std::collections::HashMap;
|
||||||
|
use std::io::Read;
|
||||||
use std::path::PathBuf;
|
use std::path::PathBuf;
|
||||||
use std::sync::Arc;
|
use std::sync::Arc;
|
||||||
use tokio::sync::Mutex;
|
use tokio::sync::Mutex;
|
||||||
|
use tokio_util::io::ReaderStream;
|
||||||
|
|
||||||
/// An asynchronous wrapper around the `ItemService` for use in async contexts like the web server.
|
/// An asynchronous wrapper around the `ItemService` for use in async contexts like the web server.
|
||||||
/// It uses `tokio::task::spawn_blocking` to run synchronous database and filesystem operations
|
/// It uses `tokio::task::spawn_blocking` to run synchronous database and filesystem operations
|
||||||
@@ -207,7 +209,7 @@ impl AsyncItemService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Create a stream that reads the content in chunks
|
// Create a stream that reads the content in chunks
|
||||||
let stream = tokio_stream::wrappers::ReaderStream::new(reader);
|
let stream = ReaderStream::new(reader);
|
||||||
|
|
||||||
// If length is specified, we need to limit the stream
|
// If length is specified, we need to limit the stream
|
||||||
let limited_stream = if length > 0 {
|
let limited_stream = if length > 0 {
|
||||||
|
|||||||
Reference in New Issue
Block a user