Files
smart_grid_iot/server/src/task/icc_analog_sync.task.ts
T

19 lines
722 B
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import type { BuiltinJob } from "./job_registry";
/**
* 模拟量数据同步任务:从 ICC 平台按 deviceCode 分批拉取探测器最新模拟量,
* 以同步时间作采集时间写入 electricity_data(按 line_code/analog_type/collect_time 幂等),
* 写 icc_sync_log。默认每 5 分钟执行一次。
*/
export const iccAnalogSyncJob: BuiltinJob = {
jobKey: "icc_analog_sync",
jobName: "模拟量数据同步",
description: "拉取 ICC 平台探测器最新模拟量,以同步时间作采集时间写入 electricity_data(写 icc_sync_log)",
defaultCron: "*/5 * * * *",
defaultParams: {},
paramFields: [],
handler: async (_params, ctx) => {
return ctx.runtime.syncIccAnalogs();
}
};