小编Noo*_*der的帖子

使用带有 Http 触发器的取消令牌的 Azure 函数

我正在使用取消令牌在 Azure 中开发一个函数。它是一个 Http 触发器。

我在方法参数中传入了一个取消令牌。

其长运行功能。我在进程之间取消了请求,但进程继续运行并且取消令牌不生效。

这在 Azure Functions 中是否支持,如果我在两者之间取消 Http 请求,它也应该取消其执行,但事实并非如此。

我通过一小段代码对此进行了测试

public static class LongRunningFunction
    {
        [FunctionName("LongRunningFunction")]
        public static async Task<IActionResult> RunAsync(
            [HttpTrigger(AuthorizationLevel.Anonymous, "get", "post",  Route = "Long")]
            HttpRequest req, ILogger log, CancellationToken token)
        {
            try
            {
                await Task.Delay(10000, token);
                return new OkResult();

            }
            catch (OperationCanceledException)
            {
                return new NotFoundResult();
            }
            catch (Exception e)
            {
                return new InternalServerErrorResult();
            }
        }
    }
Run Code Online (Sandbox Code Playgroud)

我使用 Postman 执行。

难道我做错了什么?

我正在从以下链接获取帮助

c# multithreading azure cancellation-token azure-functions

9
推荐指数
2
解决办法
3415
查看次数

如何修复 Xamarin 中的 dsymutil

我正在尝试在真实设备上构建 iOS 应用程序,但不幸的是我遇到了

dsymutil exited with code 1
Run Code Online (Sandbox Code Playgroud)

我所做的事情:

  • 我确实搜索了谷歌,但它说我的硬盘已满,但事实并非如此。

  • 我确实多次尝试清理和构建 - 没有成功

  • 我确实尝试使用命令重新安装 CommandTools xcode-select --install- 没有成功

  • 我确实删除了 CommandTools,然后重新安装 - 没有成功

仅供参考

  • 我正在使用 Xcode 11.4 Beta 2

  • 我在 Xcode 上使用我的 Apple 帐户登录

我这个问题是什么原因造成的?

您想询问的任何其他信息请询问。

谢谢

构建日志:

  CIS.iOS -> D:\VS Projects\CIS\CIS\CIS\CIS.iOS\bin\iPhone\Debug\CIS.iOS.exe

  Detected signing identity:

    Code Signing Key: "#####"
 (7ECA06BC28377204C91D2E63E69C233982161B28)

    Provisioning Profile: "Development" (5aa7573d-6dc8-43e4-9bb0-c65efc5a361a)

    Bundle Id: com.#####

    App Id: 37M96SGRTW.com.#####

  /Library/Frameworks/Xamarin.iOS.framework/Versions/Current/bin/mtouch @/Users/zilon/Library/Caches/Xamarin/mtbs/builds/CIS.iOS/0e17d2ede92713351eb68ac0146dd15c/obj/iPhone/Debug/response-file.rsp --gcc_flags=-ObjC 

C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Xamarin\iOS\Xamarin.iOS.Common.targets(842,3): warning MT4174: Unable to locate the block to delegate conversion method for …
Run Code Online (Sandbox Code Playgroud)

xcode xamarin.ios dsymutil xamarin

2
推荐指数
1
解决办法
4824
查看次数