|
@@ -36,7 +36,8 @@ async function processTask(timeRange){
|
|
throw "没有数据了"
|
|
throw "没有数据了"
|
|
}
|
|
}
|
|
if(timeRange!=null){
|
|
if(timeRange!=null){
|
|
- cur_day_data[timeRange.today][timeRange.start] = {count:response.result.count}
|
|
|
|
|
|
+ const today = new Date().toISOString().split('T')[0];
|
|
|
|
+ cur_day_data[today][timeRange.start] = {count:response.result.count}
|
|
const updateResult = await manager.updateRecord(today,cur_day_data[timeRange.today]);
|
|
const updateResult = await manager.updateRecord(today,cur_day_data[timeRange.today]);
|
|
}
|
|
}
|
|
|
|
|
|
@@ -179,7 +180,7 @@ CMD.init = async function(){
|
|
_24HourRanges = CMD.generate24HourRanges()
|
|
_24HourRanges = CMD.generate24HourRanges()
|
|
// 定义任务回调函数
|
|
// 定义任务回调函数
|
|
const taskCallback = async (context) => {
|
|
const taskCallback = async (context) => {
|
|
- const { timeRange, executionTime } = context;
|
|
|
|
|
|
+ var { timeRange, executionTime } = context;
|
|
|
|
|
|
console.log('执行任务:', {
|
|
console.log('执行任务:', {
|
|
时间区间: timeRange.name,
|
|
时间区间: timeRange.name,
|
|
@@ -187,7 +188,6 @@ CMD.init = async function(){
|
|
执行时间: executionTime
|
|
执行时间: executionTime
|
|
});
|
|
});
|
|
const today = new Date().toISOString().split('T')[0];
|
|
const today = new Date().toISOString().split('T')[0];
|
|
- timeRange.today = today
|
|
|
|
for (const key in cur_day_data) {
|
|
for (const key in cur_day_data) {
|
|
if (Object.prototype.hasOwnProperty.call(cur_day_data, key)) {
|
|
if (Object.prototype.hasOwnProperty.call(cur_day_data, key)) {
|
|
if(key==today){
|
|
if(key==today){
|
|
@@ -262,6 +262,7 @@ CMD.init = async function(){
|
|
timeFormat: new Date(timestamp).toLocaleString() // 可读的时间格式
|
|
timeFormat: new Date(timestamp).toLocaleString() // 可读的时间格式
|
|
});
|
|
});
|
|
}
|
|
}
|
|
|
|
+ console.log("ranges:",ranges)
|
|
return ranges;
|
|
return ranges;
|
|
}
|
|
}
|
|
|
|
|