Skip to content

Commit

Permalink
Merge branch 'oddfar:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
LeiDuang authored Mar 25, 2024
2 parents 6867834 + 7a45518 commit 4649e98
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
import java.util.concurrent.TimeUnit;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import java.util.Random;

@Service
public class IMTServiceImpl implements IMTService {
Expand Down Expand Up @@ -191,6 +192,11 @@ public void reservation(IUser iUser) {
//预约
JSONObject json = reservation(iUser, itemId, shopId);
logContent += String.format("[预约项目]:%s\n[shopId]:%s\n[结果返回]:%s\n\n", itemId, shopId, json.toString());

//随机延迟3~5秒
Random random = new Random();
int sleepTime = random.nextInt(3) + 3;
Thread.sleep(sleepTime * 1000);
} catch (Exception e) {
logContent += String.format("执行报错--[预约项目]:%s\n[结果返回]:%s\n\n", itemId, e.getMessage());
}
Expand Down

0 comments on commit 4649e98

Please sign in to comment.