Analysis of dnn scheduling management (2) -- custom scheduling task

Source: Internet
Author: User
Tags dnn
As mentioned above Dnn Can provide custom scheduling service, in order Dnn Implement custom Scheduling ,
Developers need to create a class inherited from Dotnetnuke. Services. Scheduling. schedulerclient
( In$ Dnnnroot/ Providers/scheduling/ Subdirectory)And must provide a constructor and
OneDowork ()Method, you can set in the constructorSchedulehistoryitemIs the introduced parameter;
InDowork ()In the method, you need to set your logicCodeIncluded inTry-catchCapture abnormal code blocks.
Parse code
For example, a scheduling task provided below stores all the log files in a corresponding file.
Folder (we can set this scheduling Program Run Once every day, and the folder name is the scheduling task execution
Line date), which undoubtedly provides great convenience for massive log file management! Note that
Dowork () The implementation of the method is as follows:


1)Me. progressingThis means that the scheduling service task is being executed.
Level task is very useful, although this is optional


2) me. schedulehistoryitem. succeeded = true after the task is completed,
the value must be assigned here

3) if you need to add some information to the execution history of the scheduling service, you need to call
addlognode () method


4)An error must be caught. If the scheduling service encounters an exception


The code is implemented as follows:


 

Once the custom class is compiledDnnThe scheduling list is added to the scheduling service.
And can be executed to implement its scheduling function.

Note:The above program annotation is marked with"Required"Must be implemented, so that the Scheduler
In order to be processed and correctly executed in a unified manner. 

To be continued... I am going to explain how to use the dnn scheduling service in dnn practice !!

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.