From 4b18a96fa0dac4ebae070ce536accc59b2085cf7 Mon Sep 17 00:00:00 2001 From: Vincent Breitmoser Date: Tue, 20 Jul 2021 12:47:00 +0200 Subject: [PATCH] db: log into epoch instead of date files --- Cargo.lock | 1 - database/Cargo.toml | 1 - database/src/lib.rs | 6 ++---- 3 files changed, 2 insertions(+), 6 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 012ab20..5169a66 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -844,7 +844,6 @@ version = "0.1.0" dependencies = [ "anyhow 1.0.34 (registry+https://github.com/rust-lang/crates.io-index)", "base64 0.10.1 (registry+https://github.com/rust-lang/crates.io-index)", - "chrono 0.4.19 (registry+https://github.com/rust-lang/crates.io-index)", "fs2 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)", "hex 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", "idna 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", diff --git a/database/Cargo.toml b/database/Cargo.toml index aad15a7..9821c47 100644 --- a/database/Cargo.toml +++ b/database/Cargo.toml @@ -21,7 +21,6 @@ pathdiff = "0.1" idna = "0.1" fs2 = "0.4" walkdir = "2.2" -chrono = "0.4" zbase32 = "0.1.2" [lib] diff --git a/database/src/lib.rs b/database/src/lib.rs index cf356c3..d1babb7 100644 --- a/database/src/lib.rs +++ b/database/src/lib.rs @@ -6,8 +6,6 @@ use std::str::FromStr; use openpgp::serialize::SerializeInto; -use chrono::prelude::Utc; - #[macro_use] extern crate anyhow; use anyhow::Result; @@ -24,7 +22,6 @@ extern crate time; extern crate url; extern crate hex; extern crate walkdir; -extern crate chrono; extern crate zbase32; use tempfile::NamedTempFile; @@ -39,6 +36,7 @@ use openpgp::{ pub mod types; use types::{Email, Fingerprint, KeyID}; +use updates::Epoch; pub mod wkd; pub mod sync; @@ -347,7 +345,7 @@ pub trait Database: Sync + Send { } fn get_current_log_filename(&self) -> String { - Utc::now().format("%Y-%m-%d").to_string() + Epoch::current().expect("not the end of time").to_string() } fn get_tpk_status(&self, fpr_primary: &Fingerprint, known_addresses: &[Email]) -> Result {