Azure Functions Core Tools - 隐藏触发器或缓存?
Azure Functions Core Tools - hidden triggers or caching?
我正在使用 Visual Studio 2019 开发简单的 azure 函数。我正在使用 Azure Functions Core Tools,因为它们在我每次启动我的项目时都会启动。
功能有时间触发和activity触发。每次我再次启动我的项目时,Azure Functions Core Tools 也会启动 - 现在有线正在发生:
看起来这些函数不仅按预期从当前 运行 时间调用了一次 - 而且还从旧触发器调用了一次,运行ning 仍在后台。如果停在其中一个功能中,它有时会从我之前的 运行 个项目中获取 "old" 数据。我也收到关于未知函数的警告,我在我的项目中重命名了十几 运行s 之前。
我清除了我的项目的 /bin/ 路径 - 但旧功能似乎还存在于隐藏缓存或 Azure Functions Core Tools 的隐藏 运行time 之类的东西中。
在 Azure Functions Core Tools 中我的项目每次新开始之前,我可以运行 进行主停止或主清理吗?
而且这种行为是否也可能发生在真实的 Azure 环境中 - 因为我看到那里的时间触发函数 运行 以更快的周期运行 运行 - 可能仍然触发运行之前已发布实例的 ning 计时器?
如果您正在使用 Durable Framework(根据您之前的问题),您需要删除存储工件,否则它将执行之前未完成的执行。
有几种方法可以做到这一点:
[FunctionName("PurgeInstanceHistory")]
public static Task Run(
[DurableClient] IDurableOrchestrationClient client,
[TimerTrigger("0 0 12 * * *")]TimerInfo myTimer)
{
return client.PurgeInstanceHistoryAsync(
DateTime.MinValue,
DateTime.UtcNow.AddDays(-30),
new List<OrchestrationStatus>
{
OrchestrationStatus.Completed
});
}
您也可以使用 CLI:
func durable delete-task-hub --task-hub-name UserTest
作为另一种选择,您可以使用 Microsoft Azure 存储资源管理器手动删除工件并将其连接到本地存储模拟器:
我正在使用 Visual Studio 2019 开发简单的 azure 函数。我正在使用 Azure Functions Core Tools,因为它们在我每次启动我的项目时都会启动。
功能有时间触发和activity触发。每次我再次启动我的项目时,Azure Functions Core Tools 也会启动 - 现在有线正在发生:
看起来这些函数不仅按预期从当前 运行 时间调用了一次 - 而且还从旧触发器调用了一次,运行ning 仍在后台。如果停在其中一个功能中,它有时会从我之前的 运行 个项目中获取 "old" 数据。我也收到关于未知函数的警告,我在我的项目中重命名了十几 运行s 之前。
我清除了我的项目的 /bin/ 路径 - 但旧功能似乎还存在于隐藏缓存或 Azure Functions Core Tools 的隐藏 运行time 之类的东西中。
在 Azure Functions Core Tools 中我的项目每次新开始之前,我可以运行 进行主停止或主清理吗?
而且这种行为是否也可能发生在真实的 Azure 环境中 - 因为我看到那里的时间触发函数 运行 以更快的周期运行 运行 - 可能仍然触发运行之前已发布实例的 ning 计时器?
如果您正在使用 Durable Framework(根据您之前的问题),您需要删除存储工件,否则它将执行之前未完成的执行。
有几种方法可以做到这一点:
[FunctionName("PurgeInstanceHistory")]
public static Task Run(
[DurableClient] IDurableOrchestrationClient client,
[TimerTrigger("0 0 12 * * *")]TimerInfo myTimer)
{
return client.PurgeInstanceHistoryAsync(
DateTime.MinValue,
DateTime.UtcNow.AddDays(-30),
new List<OrchestrationStatus>
{
OrchestrationStatus.Completed
});
}
您也可以使用 CLI:
func durable delete-task-hub --task-hub-name UserTest
作为另一种选择,您可以使用 Microsoft Azure 存储资源管理器手动删除工件并将其连接到本地存储模拟器: