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 has_parseable_json = obj_store.get_object(&rel_path).await.is_ok();
106
107
107
-
let has_dirs = match obj_store.list_dirs_in_storage().await{
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{
108
111
Ok(dirs) => !dirs.is_empty(),
109
112
Err(_) => false,
110
113
};
111
114
112
115
let has_streams = obj_store.list_streams().await.is_ok();
113
116
114
-
if !has_dirs || has_parseable_json && has_streams {
115
-
Ok(())
116
-
}elseif has_parseable_json && !has_streams {
117
-
Err(ObjectStorageError::Custom(
118
-
"Could not start the server because storage contains stale data from previous deployment, please choose an empty storage and restart the server.\nJoin us on Parseable Slack to report this incident : launchpass.com/parseable"
"Could not start the server because storage contains some stale data, please provide an empty storage and restart the server.\nJoin us on Parseable Slack to report this incident : launchpass.com/parseable".to_owned(),
124
-
))
125
-
}else{
126
-
Err(ObjectStorageError::Custom(
127
-
"Could not start the server because storage contains stale data from previous deployment.\nJoin us on Parseable Slack to report this incident : launchpass.com/parseable"
128
-
.to_owned()
129
-
))
117
+
if has_streams || !has_dirs && !has_parseable_json {
118
+
returnOk(())
130
119
}
120
+
121
+
Err(ObjectStorageError::Custom(format!("Could not start the server because {} contains stale data, please choose an empty {} and restart the server.\n{}",self.mode_string(),self.mode_string(),JOIN_COMMUNITY)))
0 commit comments