Commit a211073a authored by shiyu's avatar shiyu

上新通知测试环境不执行

parent f15e607c
......@@ -7,13 +7,11 @@ import com.wwdz.ch.core.entity.LogisticsRequestDto;
import com.wwdz.ch.core.entity.TrailInfo;
import com.wwdz.ch.core.type.Result;
import com.wwdz.ch.core.util.Base64;
import com.wwdz.ch.core.util.OkHttpUtil;
import com.xxdxxs.utils.JsonUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;
import java.io.*;
import java.net.HttpURLConnection;
import java.net.URL;
......
......@@ -182,7 +182,6 @@ public class SelfPageServiceImpl implements SelfPageService {
}
}
selfPageInfoVo.setUserOfferNum(num);
return Result.success(selfPageInfoVo);
} catch (Exception e) {
logger.error("查询藏家个人主页失败 error : {}", e);
......
......@@ -18,6 +18,7 @@ import org.redisson.api.RedissonClient;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
import org.springframework.util.CollectionUtils;
......@@ -55,11 +56,19 @@ public class NewItemNoticeJob {
@Autowired
AliSmsSender aliSmsSender;
@Value("${spring.profiles.active}")
private String env;
/**
* 每天晚上八点执行一次
*/
//@Scheduled(cron = "0 0 20 * * ?")
@Scheduled(cron = "0 0 20 * * ?")
public void execute() {
if ("dev".equals(env)) {
logger.info(">>>>>>>>>>>>>>>>>>>>>>> dev环境, 不执行发送商品上新通知定时作业<<<<<<<<<<<<<<<<<<<<<");
return;
}
RLock lock = redissonClient.getLock(NEW_ITEM_NOTICE_KEY);
if (!lock.tryLock()) {
logger.warn("发送商品上新通知,当前服务实例获取锁成功: {} 获取锁失败,锁被占用不执行", Thread.currentThread().getId());
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment