Authored by htoooth

fix

@@ -4,6 +4,7 @@ const schedule = require('node-schedule'); @@ -4,6 +4,7 @@ const schedule = require('node-schedule');
4 const Router = require('koa-router'); 4 const Router = require('koa-router');
5 const moment = require('moment'); 5 const moment = require('moment');
6 const Check = require('../../ci/checkcode'); 6 const Check = require('../../ci/checkcode');
  7 +const sendEmail = require('./profile').sendEmail;
7 8
8 const { 9 const {
9 Project, 10 Project,
@@ -111,6 +112,8 @@ module.exports = { @@ -111,6 +112,8 @@ module.exports = {
111 new Check(p.name, p.gitlab, p.checkbranch || 'master').check(); 112 new Check(p.name, p.gitlab, p.checkbranch || 'master').check();
112 } 113 }
113 }); 114 });
  115 +
  116 + sendEmail();
114 }); 117 });
115 }, 118 },
116 }; 119 };
@@ -459,17 +459,5 @@ async function sendEmail() { @@ -459,17 +459,5 @@ async function sendEmail() {
459 459
460 module.exports = { 460 module.exports = {
461 router: r, 461 router: r,
462 - async report() {  
463 - let rule = new schedule.RecurrenceRule();  
464 -  
465 - rule.dayOfWeek = [0, new schedule.Range(1, 6)];  
466 - rule.hour = 23;  
467 - rule.minute = 58;  
468 -  
469 - // await sendEmail().catch(console.log);  
470 -  
471 - schedule.scheduleJob(rule, async() => {  
472 - await sendEmail();  
473 - });  
474 - } 462 + sendEmail
475 }; 463 };
@@ -4,8 +4,8 @@ const moment = require('moment'); @@ -4,8 +4,8 @@ const moment = require('moment');
4 function reporter(data, cb) { 4 function reporter(data, cb) {
5 const mailOptions = { 5 const mailOptions = {
6 from: 'automan@yoho.cn', 6 from: 'automan@yoho.cn',
7 - // to: 'webtech@yoho.cn',  
8 - to: 'tao.huang@yoho.cn', 7 + to: 'webtech@yoho.cn',
  8 + // to: 'tao.huang@yoho.cn',
9 subject: `线上项目错误结果最近三天结果汇总 ` + moment().format('YYYY-MM-DD HH:mm:ss'), 9 subject: `线上项目错误结果最近三天结果汇总 ` + moment().format('YYYY-MM-DD HH:mm:ss'),
10 html: tpl(data['yohobuy-node']) + tpl(data['yohobuywap-node']) 10 html: tpl(data['yohobuy-node']) + tpl(data['yohobuywap-node'])
11 }; 11 };
@@ -36,12 +36,9 @@ const mastersUrl = [ @@ -36,12 +36,9 @@ const mastersUrl = [
36 '/users' 36 '/users'
37 ]; 37 ];
38 38
39 -// 代码规则检查 39 +// 日常规则检查
40 checkcode.check(); 40 checkcode.check();
41 41
42 -// 错误报告  
43 -profile.report();  
44 -  
45 // 服务器监控数据采集 42 // 服务器监控数据采集
46 collectData.collect(); 43 collectData.collect();
47 44
@@ -26,14 +26,16 @@ @@ -26,14 +26,16 @@
26 word-break:break-all; 26 word-break:break-all;
27 } 27 }
28 28
29 - pre { 29 +pre {
30 padding: 10px; 30 padding: 10px;
31 overflow: hidden; 31 overflow: hidden;
32 32
33 font-family: consolas,monospace; 33 font-family: consolas,monospace;
34 34
35 - word-wrap: normal; 35 + word-wrap: break-word;
  36 + word-break:break-all;
36 } 37 }
  38 +
37 .errdetail { 39 .errdetail {
38 margin-top: 10px; 40 margin-top: 10px;
39 41