We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
function genFlakeId() { const flakeIdGen = new FlakeId(); return intformat(flakeIdGen.next(), 'dec'); } const ids = []; for (let i = 0; i < 50; i++) { ids.push(genFlakeId()); } // ids [ "6901552045816283136", "6901552045820477440", "6901552045820477440", "6901552045833060352", "6901552045837254656", "6901552045841448960", "6901552045845643264", "6901552045849837568", "6901552045854031872", "6901552045858226176", "6901552045862420480", "6901552045875003392", "6901552045879197696", "6901552045879197696", "6901552045879197696", "6901552045883392000", "6901552045883392000", "6901552045883392000", "6901552045883392000", "6901552045883392000", "6901552045887586304", "6901552045887586304", "6901552045887586304", "6901552045887586304", "6901552045887586304", "6901552045891780608", "6901552045891780608", "6901552045891780608", "6901552045891780608", "6901552045891780608", "6901552045895974912", "6901552045895974912", "6901552045895974912", "6901552045895974912", "6901552045900169216", "6901552045900169216", "6901552045900169216", "6901552045900169216", "6901552045900169216", "6901552045904363520", "6901552045904363520", "6901552045904363520", "6901552045908557824", "6901552045908557824", "6901552045908557824", "6901552045912752128", "6901552045912752128", "6901552045912752128", "6901552045916946432", "6901552045916946432" ]
The text was updated successfully, but these errors were encountered:
'cause you made a new FakeId instance in every push. They were not related(with their counters) so they raced.
push
You should do something like this
const flakeIdGen = new FlakeId(); function genFlakeId() { return intformat(flakeIdGen.next(), 'dec'); } const ids = []; for (let i = 0; i < 50; i++) { ids.push(genFlakeId()); }
Sorry, something went wrong.
'cause you made a new FakeId instance in every push. They were not related(with their counters) so they raced. You should do something like this const flakeIdGen = new FlakeId(); function genFlakeId() { return intformat(flakeIdGen.next(), 'dec'); } const ids = []; for (let i = 0; i < 50; i++) { ids.push(genFlakeId()); }
thanks
No branches or pull requests
The text was updated successfully, but these errors were encountered: