zoukankan      html  css  js  c++  java
  • NopCommerce里的计划任务机制

    NopCommerce里的计划任务机制。

    一、Nop.Web.Global.asax.cs

       1: protected void Application_Start()
       2: {
       3:     ........
       4:     //start scheduled tasks
       5:     if (databaseInstalled)
       6:     {
       7:         TaskManager.Instance.Initialize();
       8:         TaskManager.Instance.Start();
       9:     }
      10: }

    这里加载你要做的任务.

    二.做一个你自己的计划任务

       1、依照下述(三、)中所列,为YourNewTask类做好路径,它应该有ITask接口;

       2、YourNewTask只有一个无参数的方法:Execute。在任务要执行的时候,这个方法会被调用。

       3、数据表ScheduleTask中添加一条记录。你可以手动添加,或使用IScheduleTaskService来添加记录。

    三、现有的任务:(nop 2.50)

    1    Send emails    60    Nop.Services.Messages.QueuedMessagesSendTask, Nop.Services
    2    Keep alive    300    Nop.Services.Common.KeepAliveTask, Nop.Services
    3    Delete guests    600    Nop.Services.Customers.DeleteGuestsTask, Nop.Services
    4    Clear cache    600    Nop.Services.Caching.ClearCacheTask, Nop.Services
    5    Update currency exchange rates    900    Nop.Services.Directory.UpdateExchangeRateTask, Nop.Services
    6    MailChimp sync    3600    Nop.Plugin.Misc.MailChimp.MailChimpSynchronizationTask, Nop.Plugin.Misc.MailChimp
    7    Froogle static file generation    3600    Nop.Plugin.Feed.Froogle.StaticFileGenerationTask, Nop.Plugin.Feed.Froogle

  • 相关阅读:
    Ubuntu16.04下安装搜狗输入法及实现中英文转换问题
    OLED的使用-4线SPI驱动
    maven的pom.xml多个仓库配置
    Eclipse快捷键大全
    ubuntu18安装docker
    运行docker大致流程
    docker常用命令
    使用webhooks进行代码的自动化部署
    springboot整合dubbo+zookeeper最新详细
    那些好用到手软的软件和网站
  • 原文地址:https://www.cnblogs.com/luckjason/p/2453730.html
Copyright © 2011-2022 走看看