forked from Kong/kong
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
hotfix(cli) seed random number generator in CLI
If spawning multiple nodes at once (making use of the CLI from different host machines), we need to make sure none of them are using the same seed. To enforce this, we make use of the patched 'math.randomseed()' function, which should greatly reduce the probability of seed collision. To allow for this change, we need a special flag indicating our scripts if we are running inside of our CLI, so that out 'math.randomseed()' does not complain about being called in resty-cli's 'timer' context. * add `ngx.RESTY_CLI` flag in `bin/kong` * add an edge case in our patched `math.randomseed()` * apply `kong.core.globalpatches` to our CLI environment Fix Kong#1592
- Loading branch information
1 parent
ed36c59
commit 580926a
Showing
3 changed files
with
25 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters