如何解决Azure WebJob中无法获取单例锁的问题? [英] How to resolve unable to acquire singleton lock issue in Azure WebJob?

查看:46
本文介绍了如何解决Azure WebJob中无法获取单例锁的问题?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在本地运行应用程序时,我无法获取单例锁问题.我该怎么解决?

I am getting unable to acquire singleton lock issue when I am running the application locally. How may I resolve it?

下面是我的代码

static void Main()
    {
        JobHostConfiguration config = new`enter code here` JobHostConfiguration();
        config.UseTimers();
        AutoMapperManager.SetAutomapper();
        JobHost host = new JobHost(config);

        //Task.Factory.StartNew(() => host.Call(typeof(Functions).GetMethod("GetActionItemPullData")));
        config.Tracing.ConsoleLevel = TraceLevel.Verbose;
        host.RunAndBlock();
    }

关于,优势

推荐答案

我碰巧将Web作业迁移到新的应用程序服务,但遇到了同样的错误.看完所有内容后,我弄清楚了这是什么:

It happened to me that I migrated the web jobs to a new app service and I was getting the same error. After looking at everything I figured out what it was:

确保没有任何Web作业实例在Azure中运行.这意味着,停止Azure中的Web作业.如果您定位到相同的存储帐户,则即使本地副本也不会运行.

Make sure no instance of the web job is running in Azure. That means, stop the web job in Azure. Even the local copy won't run if you are targeting the same storage account.

停止应用程序服务不会停止Web作业.您需要明确停止网络作业.

添加详细的日志记录级别对我有很大帮助.

Adding a verbose logging level helped me a lot.

config.Tracing.ConsoleLevel = System.Diagnostics.TraceLevel.Verbose;

这篇关于如何解决Azure WebJob中无法获取单例锁的问题?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆