Browse Source

function stats ready

master
filesite 8 months ago
parent
commit
1ed86bc32e
  1. 8
      heroUnion.mjs

8
heroUnion.mjs

@ -35,7 +35,9 @@ class HeroUnion { @@ -35,7 +35,9 @@ class HeroUnion {
this.task_data_max_size = 1024; //任务数据最大字节数,单位:KB
this.notify_timeout = 8; //回调通知请求超时时长,单位:秒
this.stats = {};
this.stats = {
start_time: common.getTimestampInSeconds()
};
this.heros = []; //hero爬虫队列
this.tasks = []; //任务队列
@ -329,6 +331,10 @@ class HeroUnion { @@ -329,6 +331,10 @@ class HeroUnion {
//获取联盟状态
stats() {
this.stats.taskStatus = this.taskStatus;
this.stats.heroStatus = this.heroStatus;
this.stats.run_seconds = common.getTimestampInSeconds() - this.stats.start_time;
return this.stats;
}

Loading…
Cancel
Save