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

Usage of random module is deprecated in otp19 [JIRA: TOOLS-474] #213

Closed
larshesel opened this issue Feb 15, 2017 · 1 comment
Closed

Usage of random module is deprecated in otp19 [JIRA: TOOLS-474] #213

larshesel opened this issue Feb 15, 2017 · 1 comment

Comments

@larshesel
Copy link
Contributor

larshesel commented Feb 15, 2017

Hi

After switching to a new version of the node_package I get warnings when interacting with my generated release:

_build/default/rel/vernemq/bin/vernemq ping
/home/lhc/dev/erl.io/vernemq/_build/default/rel/vernemq/bin/../erts-8.2.1/bin/nodetool:192: Warning: random:seed/1: the 'random' module is deprecated; use the 'rand' module instead
/home/lhc/dev/erl.io/vernemq/_build/default/rel/vernemq/bin/../erts-8.2.1/bin/nodetool:195: Warning: random:uniform/1: the 'random' module is deprecated; use the 'rand' module instead
/home/lhc/dev/erl.io/vernemq/_build/default/rel/vernemq/bin/../erts-8.2.1/bin/nodetool:197: Warning: random:uniform/1: the 'random' module is deprecated; use the 'rand' module instead
pong

It seems to be due to the usage of random introduced recently:

413a4ab

the only simple solution I can think of would be to replace the random:uniform(1000) with erlang:phash2(os:getpid(), 1000)? Then there's also no need for the random:seed(os:timestamp) line.

I'd be happy to create a PR for this.

@Basho-JIRA Basho-JIRA changed the title Usage of random module is deprecated in otp19 Usage of random module is deprecated in otp19 [JIRA: TOOLS-474] Feb 15, 2017
@larshesel
Copy link
Contributor Author

Since #214 was merged I'll close this. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants