Authored by 沈志敏

fix bug 邮件发送两次

@@ -29,6 +29,7 @@ class Check { @@ -29,6 +29,7 @@ class Check {
29 from: 'automan@yoho.cn', 29 from: 'automan@yoho.cn',
30 to: 'webtech@yoho.cn', 30 to: 'webtech@yoho.cn',
31 subject: `${projectname}:${branch} 代码检查一览` 31 subject: `${projectname}:${branch} 代码检查一览`
  32 + subject: `${projectname}:${branch} 代码检查一览 ` + moment().format('YYYY-MM-DD HH:mm:ss')
32 }; 33 };
33 this.id = `${projectname}_${branch}_${this.buildTime}`; 34 this.id = `${projectname}_${branch}_${this.buildTime}`;
34 35
@@ -99,11 +99,16 @@ module.exports = { @@ -99,11 +99,16 @@ module.exports = {
99 rule.hour = 23; 99 rule.hour = 23;
100 rule.minute = 59;   100 rule.minute = 59;  
101 schedule.scheduleJob(rule, function() { 101 schedule.scheduleJob(rule, function() {
  102 + let running = {};
  103 +
102 projects.forEach(async(p) => { 104 projects.forEach(async(p) => {
103 if (p.name !== 'yohobuywap-node') { // todo 暂时只检查wap站 105 if (p.name !== 'yohobuywap-node') { // todo 暂时只检查wap站
104 return; 106 return;
105 } 107 }
106 - new Check(p.name, p.gitlab, 'release/5.6').check(); 108 + if (!running[p.name]) {
  109 + running[p.name] = true;
  110 + new Check(p.name, p.gitlab, 'release/5.6').check();
  111 + }
107 }); 112 });
108 }); 113 });
109 }, 114 },