我有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永远不会被触发...
`