You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@skywalking.apache.org by GitBox <gi...@apache.org> on 2019/05/14 15:30:57 UTC

[GitHub] [skywalking] ronghuaxiang commented on issue #2668: crash tomcat spring mvc (@Scheduled task)

ronghuaxiang commented on issue #2668: crash tomcat spring mvc  (@Scheduled task)
URL: https://github.com/apache/skywalking/issues/2668#issuecomment-492288385
 
 
   `@Component
   public class SearchInfoTask{
   	
   	private static Logger LOG = LogManager.getLogger(SearchInfoTask.class);
   
   	//redis
   	@Resource
   	private IRedis redis;
   
       @Scheduled(cron="0/300 * * * * ?") //300秒执行一次
       public void loadBrandValue() {
           redis.getRedis().execute((RedisCallback) redisConnection -> {
               Map<byte[], byte[]> datas = redisConnection.hGetAll(BrandValue.getBytes());
               if(datas != null){
                   datas.forEach((k,v)->{
                       if(v!=null&&k!=null){
                           String k1 = new String(k);
                           String v1 = new String(v);
                           CacheInfoUtil.putBrandValue(k1,v1);
                           CacheInfoUtil.putKeywordBrand(k1);
                       }
                   });
               }
               return null;
           });
       }`

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services