Craig Lambie
asked on
DNN Core Scheduler - Code?
Hi Fellow DNN users,
I am trying to get the DNN scheduler to run, and I am struggling.
I have copied the code from http://www.wwwcoder.com/tabid/68/type/art/parentid/224/site/6401/default.aspx however it doesn't just work.
I am not getting any history happening, and the Job I have created fSetWindow, adds a row to a table, but it is not doing anything either.
I am not getting any exception errors, I don't believe it is being hit at all.
Project Name:WWT_DNN
File Name: WWT_Schedule
DLL Name: WWT_DNN.dll
Code Below
See attached for DNN Scheduler settings
I am trying to get the DNN scheduler to run, and I am struggling.
I have copied the code from http://www.wwwcoder.com/tabid/68/type/art/parentid/224/site/6401/default.aspx however it doesn't just work.
I am not getting any history happening, and the Job I have created fSetWindow, adds a row to a table, but it is not doing anything either.
I am not getting any exception errors, I don't believe it is being hit at all.
Project Name:WWT_DNN
File Name: WWT_Schedule
DLL Name: WWT_DNN.dll
Code Below
See attached for DNN Scheduler settings
Imports System.Configuration
Imports DotNetNuke
Imports System.Web
Imports WWT_dnn_Functions.Functions
Namespace WWT_DNN
Public Class WWT_Schedule
Inherits DotNetNuke.Services.Scheduling.SchedulerClient
Public Sub New(ByVal objScheduleHistoryItem As DotNetNuke.Services.Scheduling.ScheduleHistoryItem)
MyBase.New()
Me.ScheduleHistoryItem = objScheduleHistoryItem
End Sub
Public Overrides Sub DoWork()
Try
For i = 0 To 1000000000
Next
fSetWindow(strType:="Send", UserID:=1, iCreditsHold:=0, CodeID:=1, MobileID:=1, iMins:=180)
Me.ScheduleHistoryItem.AddLogNote("RSS Incremental Build Suceeded")
Me.ScheduleHistoryItem.Succeeded = True
Catch ex As Exception
Me.ScheduleHistoryItem.Succeeded = False
Me.ScheduleHistoryItem.AddLogNote("Index build failed. " & ex.ToString)
Me.Errored(ex)
End Try
End Sub
End Class
End Namespace
DNN-SchedulerSettings.png
Another question have you checked event viewer to see if something is going wrong in your class ?
Paolo
Paolo
ASKER
Hi,
DNN v 4.9.1
I am not sure how to view event viewer? Can you explain that a little?
I have had a look at Event Viewer, I can't find anything to do with it?
Thanks
C
DNN v 4.9.1
I am not sure how to view event viewer? Can you explain that a little?
I have had a look at Event Viewer, I can't find anything to do with it?
Thanks
C
admin -> event viewer
Just to be sure, what have you on host settings "Scheduler mode", you can see it by HOST->HOST settings, open section "OTHER SETTINGS"
Just to be sure, what have you on host settings "Scheduler mode", you can see it by HOST->HOST settings, open section "OTHER SETTINGS"
ASKER
Hi
I have no errors in the event viewer in DNN.
Scheduler Mode is set to "Request Mode" in Host Settings>Other Settings
The other option is "Timer Method"
C
I have no errors in the event viewer in DNN.
Scheduler Mode is set to "Request Mode" in Host Settings>Other Settings
The other option is "Timer Method"
C
ASKER
Hi Paulo,
Any Ideas??
Any Ideas??
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Hi Paolo,
Thanks for that. I copied the .vb into the AppCode folder, and recreated the Schedule Item, without the assembly name, and wackydo.... it worked.
I now have schedule history, and the job I have (updating a Db table) is working too, every minute.
You where right, I was not getting any history at all before.
Thanks.
Why does it not work as specified in the websites where I found this code? Any Ideas?
Thanks for that. I copied the .vb into the AppCode folder, and recreated the Schedule Item, without the assembly name, and wackydo.... it worked.
I now have schedule history, and the job I have (updating a Db table) is working too, every minute.
You where right, I was not getting any history at all before.
Thanks.
Why does it not work as specified in the websites where I found this code? Any Ideas?
I think could be a namespace or assembly name issue, but if you have a WWT_DNN.dll file on your bin folder I don't see any mistake, or could be caused by the context in which method DoWork is called, try to change to "timer mode" to execute outside the user request context.
ASKER
I tried the timer method already, that didn't work either.
Thanks for all your help, appreciate it.
C
Thanks for all your help, appreciate it.
C
Paolo.