mirror of
https://github.com/meilisearch/MeiliSearch
synced 2025-07-04 12:27:13 +02:00
Unwrap or unknown the commit hash
This commit is contained in:
parent
1782753387
commit
a8c146fd13
3 changed files with 7 additions and 17 deletions
|
@ -245,14 +245,8 @@ struct VersionResponse {
|
|||
}
|
||||
|
||||
async fn get_version(_data: GuardedData<Private, Data>) -> HttpResponse {
|
||||
let commit_sha = match option_env!("COMMIT_SHA") {
|
||||
Some("") | None => env!("VERGEN_GIT_SHA"),
|
||||
Some(commit_sha) => commit_sha,
|
||||
};
|
||||
let commit_date = match option_env!("COMMIT_DATE") {
|
||||
Some("") | None => env!("VERGEN_GIT_COMMIT_TIMESTAMP"),
|
||||
Some(commit_date) => commit_date,
|
||||
};
|
||||
let commit_sha = option_env!("VERGEN_GIT_SHA").unwrap_or("unknown");
|
||||
let commit_date = option_env!("VERGEN_GIT_COMMIT_TIMESTAMP").unwrap_or("unknown");
|
||||
|
||||
HttpResponse::Ok().json(VersionResponse {
|
||||
commit_sha: commit_sha.to_string(),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue