我正在尝试将任务配置为每 5 秒运行一次(在生产中,频率将设置为 30 分钟,但我将其设置为 5 秒以进行调试)。
<scheduling>
<!-- Time between checking for scheduled tasks waiting to execute -->
<frequency>00:00:10</frequency>
....
<agent type="MyStuff.Sitecore.Tasks.UpdateJob" method="Run" interval="00:00:05">
<LogActivity>true</LogActivity>
</agent>
我的课看起来像:
namespace MyStuff.Sitecore.Tasks
{
public class UpdateJob
{
public void Run()
{
//debugger never enters here
}
}
}
但无论如何,代码似乎永远不会被调用。我试过点击其他网页,所以我知道 asp.net 工作进程还活着。
该类位于网站项目中调用的共享库中,因此无论 sitecore 配置正在寻找该MyStuff.Sitecore.Tasks.UpdateJob
类型,都应该能够找到它。另外,我检查了 Sitecore 日志,我没有看到任何错误或与任务有关的任何内容
知道我缺少什么吗?
编辑我在日志中看到的唯一“可疑”是:
ManagedPoolThread #12 15:53:10 INFO Starting update of index for the database 'master' (1 pending).
ManagedPoolThread #12 15:53:10 INFO Update of index for the database 'master' done.
ManagedPoolThread #18 15:53:36 ERROR Exception in geoip worker thread.
Exception: System.Reflection.TargetInvocationException
Message: Exception has been thrown by the target of an invocation.
Source: mscorlib
at System.RuntimeMethodHandle._InvokeConstructor(IRuntimeMethodInfo method, Object[] args, SignatureStruct& signature, RuntimeType declaringType)
at System.RuntimeMethodHandle.InvokeConstructor(IRuntimeMethodInfo method, Object[] args, SignatureStruct signature, RuntimeType declaringType)
at System.Reflection.RuntimeConstructorInfo.Invoke(BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
at Sitecore.Reflection.ReflectionUtil.CreateObject(Type type, Object[] parameters)
at Sitecore.Configuration.Factory.CreateFromTypeName(XmlNode configNode, String[] parameters, Boolean assert)
at Sitecore.Configuration.Factory.CreateObject(XmlNode configNode, String[] parameters, Boolean assert, IFactoryHelper helper)
at Sitecore.Configuration.Factory.GetProviders[TProvider,TCollection](List`1 nodes)
at Sitecore.Configuration.Factory.GetProviders[TProvider,TCollection](String rootPath, TProvider& defaultProvider)
at Sitecore.Configuration.ProviderHelper`2.ReadProviders()
at Sitecore.Configuration.ProviderHelper`2.get_Provider()
at Sitecore.Analytics.Lookups.GeoIpWorker.ProcessGeoIp()
at Sitecore.Analytics.Lookups.GeoIpWorker.<Wakeup>b__3(Object a)
我正在使用 Sitecore 6.5