Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix erlang time module compatibility #883

Merged
merged 1 commit into from
Oct 11, 2017

Commits on Oct 11, 2017

  1. Fix erlang time module compatibility

    `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 added a new `couch_util:unique_monotonic_integer/0`.
    
    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.
    
    Also exported function `utc_random/0` was not used, after updating the function
    it wasn't exported anymore.
    nickva committed Oct 11, 2017
    Configuration menu
    Copy the full SHA
    5600f10 View commit details
    Browse the repository at this point in the history