refactor time functions to tools

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
This commit is contained in:
Dominik Csapak
2020-06-10 12:02:56 +02:00
committed by Wolfgang Bumiller
parent 3d68536fc2
commit e693818afc
7 changed files with 39 additions and 33 deletions

View File

@ -5,7 +5,7 @@ use std::io::{Seek, SeekFrom};
use super::chunk_stat::*;
use super::chunk_store::*;
use super::IndexFile;
use crate::tools;
use crate::tools::{self, epoch_now_u64};
use chrono::{Local, TimeZone};
use std::fs::File;
@ -290,9 +290,7 @@ impl FixedIndexWriter {
panic!("got unexpected header size");
}
let ctime = std::time::SystemTime::now()
.duration_since(std::time::SystemTime::UNIX_EPOCH)?
.as_secs();
let ctime = epoch_now_u64()?;
let uuid = Uuid::generate();