diff options
author | Alex Auvolat <alex@adnab.me> | 2021-12-17 11:53:13 +0100 |
---|---|---|
committer | Alex Auvolat <alex@adnab.me> | 2022-01-04 12:46:41 +0100 |
commit | b1cfd16913e6957739958ef729b87c1bf3674a5d (patch) | |
tree | 781245de967e0c7a14cbdc0f2a610787f3b852d4 /src/util/time.rs | |
parent | 5db600e2316b80102e3fd4df9e8974c9586aec9c (diff) | |
download | garage-b1cfd16913e6957739958ef729b87c1bf3674a5d.tar.gz garage-b1cfd16913e6957739958ef729b87c1bf3674a5d.zip |
New buckets for 0.6.0: small fixes, including:
- ensure bucket names are correct aws s3 names
- when making aliases, ensure timestamps of links in both ways are the
same
- fix small remarks by trinity
- don't have a separate website_access field
Diffstat (limited to 'src/util/time.rs')
-rw-r--r-- | src/util/time.rs | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/util/time.rs b/src/util/time.rs index d9192443..257b4d2a 100644 --- a/src/util/time.rs +++ b/src/util/time.rs @@ -15,6 +15,11 @@ pub fn increment_logical_clock(prev: u64) -> u64 { std::cmp::max(prev + 1, now_msec()) } +/// Increment two logical clocks +pub fn increment_logical_clock_2(prev: u64, prev2: u64) -> u64 { + std::cmp::max(prev2 + 1, std::cmp::max(prev + 1, now_msec())) +} + /// Convert a timestamp represented as milliseconds since UNIX Epoch to /// its RFC3339 representation, such as "2021-01-01T12:30:00Z" pub fn msec_to_rfc3339(msecs: u64) -> String { |