File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed
Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -884,11 +884,11 @@ def uuid7():
884884 _last_counter_v7_overflow = False
885885 else :
886886 if timestamp_ms < _last_timestamp_v7 :
887+ # The clock went backwards or we are within the same timestamp
888+ # after a counter overflow. We follow the RFC for in the former
889+ # case. In the latter case, we re-use the already advanced
890+ # timestamp (it was updated when we detected the overflow).
887891 if _last_counter_v7_overflow :
888- # The clock went backward but RFC asks to update the timestamp
889- # and advance the previous counter. We however do not want to
890- # advance the timestamp again if we already advanced it once
891- # due to an overflow (re-use the already advanced timestamp).
892892 timestamp_ms = _last_timestamp_v7
893893 else :
894894 timestamp_ms = _last_timestamp_v7 + 1
You can’t perform that action at this time.
0 commit comments