You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

test.js 476 B

4 years ago
123456789101112131415161718192021
  1. /**
  2. * @description:
  3. * @author: bubao
  4. * @date: 2021-04-27 17:23:36
  5. * @last author: bubao
  6. * @last edit time: 2021-04-28 10:34:24
  7. */
  8. const GenId = require('..')
  9. const Redis = require("ioredis");
  10. const config = require("../env.config.js");
  11. const redis = new Redis(config);
  12. const genid = new GenId({ WorkerId: (process.argv[2] || 1) - 0 });
  13. (async () => {
  14. for (let index = 0; index < 5000; index++) {
  15. await redis.sadd("setTest", genid.NextId());
  16. }
  17. redis.end();
  18. })();