diff options
author | metamuffin <metamuffin@disroot.org> | 2025-05-04 15:11:11 +0200 |
---|---|---|
committer | metamuffin <metamuffin@disroot.org> | 2025-05-04 15:11:11 +0200 |
commit | 3cbe45e24355396645b9a721fdca6d5116bd1c36 (patch) | |
tree | ecc5e61167c47362c49375e542bf6752aad12b09 /logic | |
parent | 0a5c23757c2a0fc8784ea1b5a3ad5b0cba0709e0 (diff) | |
download | jellything-3cbe45e24355396645b9a721fdca6d5116bd1c36.tar jellything-3cbe45e24355396645b9a721fdca6d5116bd1c36.tar.bz2 jellything-3cbe45e24355396645b9a721fdca6d5116bd1c36.tar.zst |
fix live log
Diffstat (limited to 'logic')
-rw-r--r-- | logic/Cargo.toml | 1 | ||||
-rw-r--r-- | logic/src/admin/log.rs | 4 | ||||
-rw-r--r-- | logic/src/admin/mod.rs | 14 |
3 files changed, 16 insertions, 3 deletions
diff --git a/logic/Cargo.toml b/logic/Cargo.toml index 23016f9..fd70b73 100644 --- a/logic/Cargo.toml +++ b/logic/Cargo.toml @@ -5,6 +5,7 @@ edition = "2024" [dependencies] jellyimport-asset-token = { path = "../import/asset_token" } +jellyimport = { path = "../import" } jellycommon = { path = "../common" } jellydb = { path = "../database" } log = "0.4.27" diff --git a/logic/src/admin/log.rs b/logic/src/admin/log.rs index 64d23ca..7130c45 100644 --- a/logic/src/admin/log.rs +++ b/logic/src/admin/log.rs @@ -44,9 +44,9 @@ pub fn get_log_buffer(warn: bool) -> VecDeque<Arc<LogLine>> { } pub fn get_log_stream(warn: bool) -> broadcast::Receiver<Arc<LogLine>> { if warn { - LOGGER.stream.0.subscribe() - } else { LOGGER.stream.1.subscribe() + } else { + LOGGER.stream.0.subscribe() } } diff --git a/logic/src/admin/mod.rs b/logic/src/admin/mod.rs index 270a732..2545ba4 100644 --- a/logic/src/admin/mod.rs +++ b/logic/src/admin/mod.rs @@ -4,5 +4,17 @@ Copyright (C) 2025 metamuffin <metamuffin.org> */ -pub mod user; pub mod log; +pub mod user; + +use crate::session::AdminSession; +use anyhow::Result; +use jellydb::Database; +use jellyimport::IMPORT_ERRORS; + +pub async fn get_import_errors(_session: &AdminSession) -> Vec<String> { + IMPORT_ERRORS.read().await.to_owned() +} +pub fn list_invites(_session: &AdminSession, database: &Database) -> Result<Vec<String>> { + database.list_invites() +} |