mirror of
https://github.com/spacedriveapp/spacedrive.git
synced 2026-05-19 13:55:40 -04:00
committed by
GitHub
parent
98a4ba8d94
commit
d6f899a93d
@@ -89,7 +89,7 @@ impl Actor {
|
||||
if let Some(Event::Messages(event)) = res { break State::Ingesting(event) }
|
||||
}
|
||||
res = &mut rx => {
|
||||
if let Err(_) = res {
|
||||
if res.is_err() {
|
||||
debug!("messages request ignored");
|
||||
break State::WaitingForNotification
|
||||
}
|
||||
@@ -98,7 +98,7 @@ impl Actor {
|
||||
}
|
||||
}
|
||||
State::Ingesting(event) => {
|
||||
if event.messages.len() > 0 {
|
||||
if !event.messages.is_empty() {
|
||||
debug!(
|
||||
"ingesting {} operations: {} to {}",
|
||||
event.messages.len(),
|
||||
|
||||
@@ -44,8 +44,6 @@ impl Instance {
|
||||
uuid_to_bytes(id),
|
||||
vec![],
|
||||
vec![],
|
||||
format!("Instace {id}"),
|
||||
0,
|
||||
Utc::now().into(),
|
||||
Utc::now().into(),
|
||||
vec![],
|
||||
@@ -84,8 +82,6 @@ impl Instance {
|
||||
uuid_to_bytes(right.id),
|
||||
vec![],
|
||||
vec![],
|
||||
String::new(),
|
||||
0,
|
||||
Utc::now().into(),
|
||||
Utc::now().into(),
|
||||
vec![],
|
||||
@@ -101,8 +97,6 @@ impl Instance {
|
||||
uuid_to_bytes(left.id),
|
||||
vec![],
|
||||
vec![],
|
||||
String::new(),
|
||||
0,
|
||||
Utc::now().into(),
|
||||
Utc::now().into(),
|
||||
vec![],
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
use super::CompressedCRDTOperations;
|
||||
|
||||
use sd_cloud_api::RequestConfigProvider;
|
||||
use sd_core_sync::{GetOpsArgs, SyncMessage, NTP64};
|
||||
use sd_core_sync::{SyncMessage, NTP64};
|
||||
use tracing::debug;
|
||||
use uuid::Uuid;
|
||||
|
||||
|
||||
@@ -37,7 +37,7 @@ use serde::Deserialize;
|
||||
use serde_json::json;
|
||||
use specta::Type;
|
||||
use tokio::{fs, io, time::Instant};
|
||||
use tracing::{debug, info, warn};
|
||||
use tracing::{debug, error, info, warn};
|
||||
use uuid::Uuid;
|
||||
|
||||
mod error;
|
||||
@@ -177,6 +177,7 @@ impl LocationCreateArgs {
|
||||
.await
|
||||
{
|
||||
// DISABLED TO FAIL SILENTLY - HOTFIX FOR LACK OF WRITE PERMISSION PREVENTING LOCATION CREATION
|
||||
error!("Failed to write .spacedrive file: {:?}", err);
|
||||
// delete_location(node, library, location.data.id).await?;
|
||||
// Err(err)?;
|
||||
}
|
||||
|
||||
@@ -105,7 +105,12 @@ impl StatefulJob for OldMediaProcessorJobInit {
|
||||
ctx: &WorkerContext,
|
||||
data: &mut Option<Self::Data>,
|
||||
) -> Result<JobInitOutput<Self::RunMetadata, Self::Step>, JobError> {
|
||||
let Library { db, sync, .. } = ctx.library.as_ref();
|
||||
let Library {
|
||||
db,
|
||||
#[cfg(feature = "ai")]
|
||||
sync,
|
||||
..
|
||||
} = ctx.library.as_ref();
|
||||
|
||||
let location_id = self.location.id;
|
||||
let location_path =
|
||||
|
||||
@@ -40,7 +40,12 @@ const BATCH_SIZE: usize = 10;
|
||||
pub async fn old_shallow(
|
||||
location: &location::Data,
|
||||
sub_path: &PathBuf,
|
||||
library @ Library { db, sync, .. }: &Library,
|
||||
library @ Library {
|
||||
db,
|
||||
#[cfg(feature = "ai")]
|
||||
sync,
|
||||
..
|
||||
}: &Library,
|
||||
#[cfg(feature = "ai")] regenerate_labels: bool,
|
||||
node: &Node,
|
||||
) -> Result<(), JobError> {
|
||||
|
||||
@@ -68,7 +68,6 @@ mod originator {
|
||||
let original = Operations(vec![CRDTOperation {
|
||||
instance: Uuid::new_v4(),
|
||||
timestamp: sync::NTP64(0),
|
||||
id: Uuid::new_v4(),
|
||||
record_id: rmpv::Value::Nil,
|
||||
model: "name".to_string(),
|
||||
data: sd_sync::CRDTOperationData::Create,
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
use sd_crypto::{rng::CryptoRng, sys::fs};
|
||||
use sd_crypto::rng::CryptoRng;
|
||||
use std::io::{Seek, Write};
|
||||
use tempfile::tempfile;
|
||||
|
||||
@@ -9,8 +9,12 @@ fn main() {
|
||||
|
||||
file.rewind().unwrap();
|
||||
|
||||
// Erase the file (the size would normally be obtained via `fs::Metadata::len()` or similar)
|
||||
fs::erase(&mut file, 1048576 * 16, 2).unwrap();
|
||||
#[cfg(feature = "sys")]
|
||||
{
|
||||
use sd_crypto::sys::fs;
|
||||
// Erase the file (the size would normally be obtained via `fs::Metadata::len()` or similar)
|
||||
fs::erase(&mut file, 1048576 * 16, 2).unwrap();
|
||||
}
|
||||
|
||||
// Truncate the file to a length of zero
|
||||
file.set_len(0).unwrap();
|
||||
|
||||
Reference in New Issue
Block a user