From b84782fd91b14695ed2aa062f6293e229099d964 Mon Sep 17 00:00:00 2001 From: Ryan Winchester Date: Thu, 18 Apr 2024 11:14:43 -0300 Subject: [PATCH] bump version --- README.md | 2 +- lib/clock.ex | 5 +++-- mix.exs | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index ac18987..2673236 100644 --- a/README.md +++ b/README.md @@ -33,7 +33,7 @@ The package can be installed by adding `uuid_v7` to your list of dependencies in ```elixir def deps do [ - {:uuid_v7, "~> 0.4.1"} + {:uuid_v7, "~> 0.4.2"} ] end ``` diff --git a/lib/clock.ex b/lib/clock.ex index a2fb6ef..de930bf 100644 --- a/lib/clock.ex +++ b/lib/clock.ex @@ -50,8 +50,9 @@ defmodule UUIDv7.Clock do # by 1 millisecond instead to preserve order. clock = with @threshold <- update_counter(current_ts, seed) do - update_counter(current_ts + 1, seed) - :atomics.put(timestamp_ref, 1, current_ts + 1) + next_ts = current_ts + 1 + :atomics.put(timestamp_ref, 1, next_ts) + update_counter(next_ts, seed) end {current_ts, <>} diff --git a/mix.exs b/mix.exs index fbc9cd5..1c5e6ba 100644 --- a/mix.exs +++ b/mix.exs @@ -1,7 +1,7 @@ defmodule UUIDv7.MixProject do use Mix.Project - @version "0.4.1" + @version "0.4.2" @repo_url "https://github.com/ryanwinchester/uuidv7"