Muu*_*ski 3 azure azure-functions
在 Visual Studio 2017 中,我创建了一个新的 Azure Function 项目,生成以下代码:
using System;
using Microsoft.Azure.WebJobs;
using Microsoft.Azure.WebJobs.Host;
namespace FunctionApp1
{
public static class Function1
{
[FunctionName("Function1")]
public static void Run([TimerTrigger("0 */5 * * * *")]TimerInfo myTimer, TraceWriter log)
{
var lastRun = myTimer.ScheduleStatus.Last;
log.Info($"C# Timer trigger function executed at: {DateTime.Now}");
}
}
}
Run Code Online (Sandbox Code Playgroud)
我的问题是关于lastRun变量的。是吗:
我搜索了 Azure 文档,但没有找到有关 TimerInfo 对象属性的任何信息,因此了解此变量是否可用于了解函数上次运行时间会很有帮助。
| 归档时间: |
|
| 查看次数: |
6305 次 |
| 最近记录: |