2012-05-03 52 views
1

我试图配置一个任务每5秒运行一次(在生产中,频率将设置为30分钟,但我将其设置为5秒进行调试)。从web.config Sitecore任务配置

<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

回答

0

虽然我侧步你的问题有点儿,我从来没有成功地在调度任务时调用调试器。我改为使用Sitecore.Diagnostics.Log,然后查看相关的调试级别。通常情况下,我觉得这很有限,但使用第三方尾部工具时,您可以在发生日志时轻松观看日志。

也许这会给你一个中间解决方案,直到别人回答。

+0

我没有记录在工作本身是在日志中。日志正在记录在正常的Web请求上处理的东西,所以我认为该任务只是没有运行 – lurscher

+2

你能否尝试更新你的代理声明为'其中Mystuff是您的程序集名称。在黑暗中拍摄,但没有其他人插话。 – al3xnull

+0

你应该发表评论作为你的答案,因为我的钱会在那。 – techphoria414

0

答案在于<frequency>00:00:10</frequency>,这应该总是和最常见的任务一样低,所以在这种情况下是00:00:05。

+0

尝试过,但没有工作 – lurscher

3

您可以尝试更新您的代理声明到<agent type="Mystuff.Sitecore.Tasks.UpdateJob, Mystuff" method="Run" interval="00:00:05">,其中Mystuff是您的程序集名称。看起来像组件缺失。

根据techphoria414的建议添加为回答。

+0

这将是这个。 –

+0

,并记住,Sitecore计划任务将启动,以防万一你打电话给你的网站! –