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 !!