Skip to content

Commit

Permalink
提前两秒开始抢购
Browse files Browse the repository at this point in the history
  • Loading branch information
lyrric committed May 21, 2021
1 parent 5fb06dc commit 16d3ee9
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions src/main/java/com/github/lyrric/service/SecKillService.java
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,6 @@ public void startSecKill(Integer vaccineId, String startDateStr, MainFrame mainF
e.printStackTrace();
}
}
if(now + 500 < startDate){
logger.info("还未到开始时间,等待中......");
Thread.sleep(startDate - now - 500);
}
Runnable runnable = ()->{
do {
try {
Expand All @@ -88,7 +84,7 @@ public void startSecKill(Integer vaccineId, String startDateStr, MainFrame mainF
} while (orderId.get() == null);
};

for (int i = 0; i < 1; i++) {
for (int i = 0; i < 20; i++) {
service.submit(runnable);
}
service.shutdown();
Expand Down

0 comments on commit 16d3ee9

Please sign in to comment.