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
long stock = redisService.decr(GoodsKey.getGoodsStock, "" + goodsId);//10 if (stock < 0) { afterPropertiesSet(); long stock2 = redisService.decr(GoodsKey.getGoodsStock, "" + goodsId);//10 if(stock2 < 0){ localOverMap.put(goodsId, true); return Result.error(CodeMsg.SECKILL_OVER); } } //判断重复秒杀 //如果重复秒杀,是否多次减库存? SeckillOrder order = orderService.getOrderByUserIdGoodsId(user.getId(), goodsId); if (order != null) { return Result.error(CodeMsg.REPEATE_SECKILL); }
预减库存后,如果是重复秒杀,redis中的库存量还是会减少,导致其他用户不能下单
The text was updated successfully, but these errors were encountered:
这个您试过了吗
Sorry, something went wrong.
您的项目启动成功了吗
这个重复判断,是不是应该要放到预减库存的前面?
我也觉得重复秒杀判断应该放到减库存前面
No branches or pull requests
预减库存后,如果是重复秒杀,redis中的库存量还是会减少,导致其他用户不能下单
The text was updated successfully, but these errors were encountered: