Mon Jun 01, 2020 10:24 pm
Login Register Lost Password? Contact Us


添加定时任务举例

这个论坛用于上传各种ECL/HPCC相关的问题及答复

Thu May 14, 2020 3:30 am Change Time Zone

我改写了官方文档中定时任务的例子,供大家参考:
Code: Select all

IMPORT TutorialYourName;
task := FUNCTION
  RETURN BUILDINDEX(TutorialYourName.IDX_PeopleByZIP,OVERWRITE);
END;
events := MODULE
  EXPORT dailyAtMidnight := CRON(‘0 0 * * *‘);
  EXPORT dailyAtMinute(INTEGER minute=0) := EVENT(‘CRON‘,(STRING)minute + ‘ * * * *‘);
  EXPORT dailyAt( INTEGER hour,INTEGER minute=0) := EVENT(‘CRON‘,(STRING)minute + ‘ ‘ + (STRING)hour + ‘ * * *‘);
  EXPORT dailyAtMidday := dailyAt(12, 0);
  EXPORT EveryThreeHours := CRON(‘0 0-23/3 * * *‘);
END;
task : WHEN(events.dailyAtMinute(36));

这个例子提交后,会出现在事件计划列表中。
hellowangzhi
 
Posts: 17
Joined: Wed Jul 04, 2018 1:29 am

Return to 中文 (Chinese)

Who is online

Users browsing this forum: No registered users and 0 guests

cron