mirror of
https://github.com/openobserve/openobserve.git
synced 2026-11-04 08:09:27 +00:00
fix: return empty when usage is not there instead of report error (#13842)
- [x] Should start check job after node start, otherwise it will report gRPC can't connect. - [x] Should skip usage check when there is no usage stream, otherwise it will always report error.
This commit is contained in:
@@ -21,6 +21,7 @@ use config::{
|
||||
search::{
|
||||
Query, Request as SearchRequest, RequestEncoding, SearchEventType, default_use_cache,
|
||||
},
|
||||
self_reporting::usage::USAGE_STREAM,
|
||||
stream::StreamType,
|
||||
},
|
||||
utils::json,
|
||||
@@ -42,6 +43,11 @@ pub async fn get_usage(
|
||||
(vec![], vec![])
|
||||
};
|
||||
|
||||
// return empty if usage stream is not there
|
||||
if !infra::schema::exists(META_ORG_ID, StreamType::Logs, USAGE_STREAM).await {
|
||||
return Ok(vec![]);
|
||||
}
|
||||
|
||||
let req = SearchRequest {
|
||||
query: Query {
|
||||
sql,
|
||||
|
||||
@@ -41,8 +41,7 @@ pub async fn run() -> Result<(), anyhow::Error> {
|
||||
{
|
||||
log::error!("[SERVICE_GRAPH::JOB] Processing failed: {e}");
|
||||
}
|
||||
},
|
||||
sleep_after
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user