Skip to content

Commit

Permalink
Minor fixes for GraphQL server (#1945)
Browse files Browse the repository at this point in the history
* nothing to write for disk graph so don't log an error

* no need to panic here
  • Loading branch information
ljeub-pometry authored Feb 12, 2025
1 parent 70e3c71 commit df64a69
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 5 deletions.
17 changes: 13 additions & 4 deletions raphtory-graphql/src/graph.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
use std::sync::Arc;

use crate::paths::ExistingGraphFolder;
use once_cell::sync::OnceCell;
#[cfg(feature = "storage")]
use raphtory::disk_graph::DiskGraphStorage;
Expand All @@ -11,7 +12,11 @@ use raphtory::{
db::{
api::{
mutation::internal::InheritMutationOps,
view::{internal::Static, Base, InheritViewOps, MaterializedGraph},
storage::graph::storage_ops::GraphStorage,
view::{
internal::{CoreGraphOps, Static},
Base, InheritViewOps, MaterializedGraph,
},
},
graph::{edge::EdgeView, node::NodeView},
},
Expand All @@ -23,8 +28,6 @@ use raphtory::{
},
};

use crate::paths::ExistingGraphFolder;

#[derive(Clone)]
pub struct GraphWithVectors {
pub graph: MaterializedGraph,
Expand Down Expand Up @@ -84,7 +87,13 @@ impl GraphWithVectors {
}

pub(crate) fn write_updates(&self) -> Result<(), GraphError> {
self.graph.write_updates()?;
match self.graph.core_graph() {
GraphStorage::Mem(_) | GraphStorage::Unlocked(_) => {
self.graph.write_updates()?;
}
#[cfg(feature = "storage")]
GraphStorage::Disk(_) => {}
}
self.dump_vectors_to_disk()
}

Expand Down
2 changes: 1 addition & 1 deletion raphtory-graphql/src/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ impl GraphServer {
config_path: Option<PathBuf>,
) -> IoResult<Self> {
if !work_dir.exists() {
fs::create_dir_all(&work_dir).unwrap();
fs::create_dir_all(&work_dir)?;
}
let config =
load_config(app_config, config_path).map_err(|err| ServerError::ConfigError(err))?;
Expand Down

0 comments on commit df64a69

Please sign in to comment.