Commit 9b83ec7e by admin

1

parent a27ef8a3
...@@ -41,15 +41,15 @@ public class MainThread extends Thread { ...@@ -41,15 +41,15 @@ public class MainThread extends Thread {
public static Map<String, Template> allTmp = new ConcurrentHashMap<String, Template>(); public static Map<String, Template> allTmp = new ConcurrentHashMap<String, Template>();
public static Map<String, String> map = new HashMap<>(); public static Map<String, String> map = new HashMap<>();
static ESUtil es = new ESUtil(); static ESUtil es = new ESUtil();
static Map<String,Integer> counts=new HashMap<>(); static Map<String, Integer> counts = new HashMap<>();
static { static {
counts.put("网媒", 1200); counts.put("网媒", 1200);
counts.put("微博", 2000); counts.put("微博", 2000);
counts.put("微信", 3500); counts.put("微信", 3500);
counts.put("知乎", 300); counts.put("知乎", 300);
// counts.put("平媒", 300); // counts.put("平媒", 300);
} }
public MainThread() { public MainThread() {
this.start(); this.start();
} }
...@@ -185,12 +185,13 @@ public class MainThread extends Thread { ...@@ -185,12 +185,13 @@ public class MainThread extends Thread {
data.setTime(start.getTime()); data.setTime(start.getTime());
dataService.insert(data); dataService.insert(data);
log.info(sdf.format(start.getTime()) + "|" + chan.getPt() + "|入库"); log.info(sdf.format(start.getTime()) + "|" + chan.getPt() + "|入库");
if(count<counts.get(chan.getPt())) { if (counts.get(chan.getPt()) != null)
Messages m=new Messages(); if (count < counts.get(chan.getPt())) {
m.setTitle("渠道低数据量预警{"+chan.getPt()+"}"); Messages m = new Messages();
m.setContent("1小时内的数据量为:"+count); m.setTitle("渠道低数据量预警{" + chan.getPt() + "}");
SendMailUtil.sendMessage(Config.getVal("count_mail"), m); m.setContent("1小时内的数据量为:" + count);
} SendMailUtil.sendMessage(Config.getVal("count_mail"), m);
}
} catch (Exception e) { } catch (Exception e) {
log.error(chan.getPt() + "入库出错,错误信息{}", e); log.error(chan.getPt() + "入库出错,错误信息{}", e);
} }
......
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