MeiliSearch/meilisearch-lib/src/analytics.rs

9 lines
296 B
Rust
Raw Normal View History

use std::{fs, path::Path};
2021-10-26 13:57:41 +02:00
/// Copy the `instance-uid` contained in one db to another. Ignore all errors.
2021-10-26 13:02:40 +02:00
pub fn copy_user_id(src: &Path, dst: &Path) {
2021-10-26 13:57:41 +02:00
if let Ok(user_id) = fs::read_to_string(src.join("instance-uid")) {
let _ = fs::write(dst.join("instance-uid"), &user_id);
}
}