You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@couchdb.apache.org by gi...@git.apache.org on 2017/10/09 22:42:04 UTC
[GitHub] nickva opened a new pull request #883: Fix erlang time module compatibility
nickva opened a new pull request #883: Fix erlang time module compatibility
URL: https://github.com/apache/couchdb/pull/883
`now/0` is deprecated since Erlang 18.0, and a set of new time related functions
are available.
Usually `now/0` can be replaced with `os:timestamp/0`, however in some
instances it was used effectively to produce monotonically incrementing values
rather than timestamps. So a new `couch_time_compat` module was created to
emulate 18.0+ `unique_integer/0,1` functionality, and code was upgraded to use it.
Most functional changes are in couch_uuid module. There `now/0` was used both
as a timestamp and for uniqueness. To emulate previous behavior, a local
incrementing clock sequence is used. If `os:timestamp/0` does not advance since
last call then the local clock is advanced by 1 microsecond and that's used to
generate the next V1 UUIDs. As soon as os:timestamp/0` catches up, the local
sequence reset to that latest value.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services