You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.
package com.dsideal.QingLong.Hk.Model ;
import com.dsideal.QingLong.Const.RedisKeyConst ;
import com.dsideal.QingLong.Util.RedisKit ;
import org.slf4j.Logger ;
import org.slf4j.LoggerFactory ;
public class RefreshHk implements Runnable {
//在独立的main函数中, 使用下面的方式进行声明logback对象
private static Logger log = LoggerFactory . getLogger ( RefreshHk . class ) ;
@Override
public void run ( ) {
while ( true ) {
if ( ! RedisKit . Exists ( RedisKeyConst . SY_KEY ) ) {
//从张永嘉处获取到数据库的变化, 根据timestamp进行获取, 同步到数据库中, 同步到redis
} else {
//当检查到没有需要处理的数据时, 休息5分钟, 然后继续探测
try {
Thread . sleep ( 5 * 6000 ) ;
} catch ( InterruptedException e ) {
e . printStackTrace ( ) ;
}
}
}
}
}