ITriggerListener的TriggerFired调用超过一个

时间:2018-06-29 00:17:16

标签: listener quartz.net

我有TriggerListener,像这样:

        private bool connectionSuccess;

        public UtmTriggerListener()
        {
        }

        public bool VetoJobExecution(ITrigger trigger, IJobExecutionContext context)
        {
            CheckConnect(context).Wait();
            return connectionSuccess;
        }

        private async Task CheckConnect(IJobExecutionContext context)
        {
            connectionSuccess = await _utmBL.CheckConnection();
        }

        public string Name
        {
            get { return "UtmTriggerListener"; }
        }

然后我为sheduler添加Listenerv

    scheduler.ListenerManager.AddTriggerListener(new UtmTriggerListener(utmBL, SetTooltipVisible),
                    KeyMatcher<TriggerKey>.KeyEquals(new TriggerKey(name, group)));

因此,TriggerComplete永远不会被触发...

`

0 个答案:

没有答案