mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2026-10-09 12:29:40 +00:00
Upgraded to Rust 1.97.0 & updated dependencies (#846)
Build and Release / Read metadata (push) Blocked by required conditions
Build and Release / Sync Flatpak repo (push) Blocked by required conditions
Build and Release / Determine run mode (push) Waiting to run
Build and Release / Collect Flatpak artifacts (push) Blocked by required conditions
Build and Release / Build app (${{ matrix.dotnet_runtime }}) (-aarch64-unknown-linux-gnu, linux-arm64, ubuntu-22.04-arm, aarch64-unknown-linux-gnu, appimage,updater, appimage) (push) Blocked by required conditions
Build and Release / Build app (${{ matrix.dotnet_runtime }}) (-x86_64-apple-darwin, osx-x64, macos-latest, x86_64-apple-darwin, dmg,app,updater, dmg) (push) Blocked by required conditions
Build and Release / Build app (${{ matrix.dotnet_runtime }}) (-x86_64-pc-windows-msvc.exe, win-x64, windows-latest, x86_64-pc-windows-msvc, nsis,updater, nsis) (push) Blocked by required conditions
Build and Release / Build app (${{ matrix.dotnet_runtime }}) (-x86_64-unknown-linux-gnu, linux-x64, ubuntu-22.04, x86_64-unknown-linux-gnu, appimage,updater, appimage) (push) Blocked by required conditions
Build and Release / Prepare & create release (push) Blocked by required conditions
Build and Release / Publish release (push) Blocked by required conditions
Build and Release / Build app (${{ matrix.dotnet_runtime }}) (-aarch64-pc-windows-msvc.exe, win-arm64, windows-latest, aarch64-pc-windows-msvc, nsis,updater, nsis) (push) Blocked by required conditions
Build and Release / Build app (${{ matrix.dotnet_runtime }}) (-aarch64-apple-darwin, osx-arm64, macos-latest, aarch64-apple-darwin, dmg,app,updater, dmg) (push) Blocked by required conditions
Build and Release / Read metadata (push) Blocked by required conditions
Build and Release / Sync Flatpak repo (push) Blocked by required conditions
Build and Release / Determine run mode (push) Waiting to run
Build and Release / Collect Flatpak artifacts (push) Blocked by required conditions
Build and Release / Build app (${{ matrix.dotnet_runtime }}) (-aarch64-unknown-linux-gnu, linux-arm64, ubuntu-22.04-arm, aarch64-unknown-linux-gnu, appimage,updater, appimage) (push) Blocked by required conditions
Build and Release / Build app (${{ matrix.dotnet_runtime }}) (-x86_64-apple-darwin, osx-x64, macos-latest, x86_64-apple-darwin, dmg,app,updater, dmg) (push) Blocked by required conditions
Build and Release / Build app (${{ matrix.dotnet_runtime }}) (-x86_64-pc-windows-msvc.exe, win-x64, windows-latest, x86_64-pc-windows-msvc, nsis,updater, nsis) (push) Blocked by required conditions
Build and Release / Build app (${{ matrix.dotnet_runtime }}) (-x86_64-unknown-linux-gnu, linux-x64, ubuntu-22.04, x86_64-unknown-linux-gnu, appimage,updater, appimage) (push) Blocked by required conditions
Build and Release / Prepare & create release (push) Blocked by required conditions
Build and Release / Publish release (push) Blocked by required conditions
Build and Release / Build app (${{ matrix.dotnet_runtime }}) (-aarch64-pc-windows-msvc.exe, win-arm64, windows-latest, aarch64-pc-windows-msvc, nsis,updater, nsis) (push) Blocked by required conditions
Build and Release / Build app (${{ matrix.dotnet_runtime }}) (-aarch64-apple-darwin, osx-arm64, macos-latest, aarch64-apple-darwin, dmg,app,updater, dmg) (push) Blocked by required conditions
This commit is contained in:
1 parent
09fa5bc15b
commit
156cce380b
5 files changed
+77
-92
No files matched your search
+1
-1
@@ -223,7 +223,7 @@ fn file_logger_format(
|
||||
write_kv_pairs(w, record)?;
|
||||
|
||||
// Write the log message:
|
||||
write!(w, "{}", &record.args())
|
||||
write!(w, "{}", record.args())
|
||||
}
|
||||
|
||||
pub async fn get_log_paths(_token: APIToken) -> Json<LogPathsResponse> {
|
||||
|
||||
+7
-15
@@ -1,31 +1,23 @@
|
||||
use std::error::Error;
|
||||
use std::sync::Mutex;
|
||||
use once_cell::sync::Lazy;
|
||||
use once_cell::sync::{Lazy, OnceCell};
|
||||
use pdfium_render::prelude::Pdfium;
|
||||
use log::{error, info, warn};
|
||||
|
||||
pub static PDFIUM_LIB_PATH: Lazy<Mutex<Option<String>>> = Lazy::new(|| Mutex::new(None));
|
||||
static PDFIUM: Lazy<Mutex<Option<Pdfium>>> = Lazy::new(|| Mutex::new(None));
|
||||
static PDFIUM: OnceCell<Pdfium> = OnceCell::new();
|
||||
|
||||
pub trait PdfiumInit {
|
||||
fn ai_studio_init() -> Result<Pdfium, Box<dyn Error + Send + Sync>>;
|
||||
fn ai_studio_init() -> Result<&'static Pdfium, Box<dyn Error + Send + Sync>>;
|
||||
}
|
||||
|
||||
impl PdfiumInit for Pdfium {
|
||||
|
||||
/// Initializes the PDFium library for AI Studio.
|
||||
fn ai_studio_init() -> Result<Pdfium, Box<dyn Error + Send + Sync>> {
|
||||
let mut pdfium = PDFIUM.lock().unwrap();
|
||||
if let Some(pdfium) = pdfium.as_ref() {
|
||||
return Ok(pdfium.clone());
|
||||
}
|
||||
|
||||
let loaded_pdfium = load_pdfium().map_err(|error| {
|
||||
fn ai_studio_init() -> Result<&'static Pdfium, Box<dyn Error + Send + Sync>> {
|
||||
PDFIUM.get_or_try_init(|| load_pdfium().map_err(|error| {
|
||||
Box::new(std::io::Error::other(error)) as Box<dyn Error + Send + Sync>
|
||||
})?;
|
||||
*pdfium = Some(loaded_pdfium.clone());
|
||||
|
||||
Ok(loaded_pdfium)
|
||||
}))
|
||||
}
|
||||
}
|
||||
|
||||
@@ -76,4 +68,4 @@ fn load_pdfium() -> Result<Pdfium, String> {
|
||||
Err(error_message)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user