You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
let rel_path = relative_path::RelativePathBuf::from(".parseable.json");
105
+
106
+
let has_parseable_json = obj_store.get_object(&rel_path).await.is_ok();
107
+
108
+
// Lists all the directories in the root of the bucket/directory
109
+
// can be a stream (if it contains .stream.json file) or not
110
+
let has_dirs = match obj_store.list_dirs().await{
111
+
Ok(dirs) => !dirs.is_empty(),
112
+
Err(_) => false,
113
+
};
114
+
115
+
let has_streams = obj_store.list_streams().await.is_ok();
116
+
117
+
if has_streams || !has_dirs && !has_parseable_json {
118
+
returnOk(());
119
+
}
120
+
121
+
ifself.mode_string() == "Local drive"{
122
+
returnErr(ObjectStorageError::Custom(format!("Could not start the server because directory '{}' contains stale data, please use an empty directory, and restart the server.\n{}",self.storage.get_endpoint(),JOIN_COMMUNITY)));
123
+
}
124
+
125
+
// S3 bucket mode
126
+
Err(ObjectStorageError::Custom(format!("Could not start the server because bucket '{}' contains stale data, please use an empty bucket and restart the server.\n{}",self.storage.get_endpoint(),JOIN_COMMUNITY)))
0 commit comments