Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeDevelopment and...Development and...DNN Platform (o...DNN Platform (o...Custom Scheduler wonCustom Scheduler won't work
Previous
 
Next
New Post
5/28/2009 9:08 AM
 

I've made the following class and put this in the App_Code directory:

Imports Microsoft.VisualBasic
Imports System.Configuration
Imports DotNetNuke
Imports System.Web
Imports DotNetNuke.Services.Scheduling

Namespace DotNetNuke.Services.Scheduling

    Public Class CurrentVisitorScheduledTask
        Inherits SchedulerClient

        Public Sub New(ByVal objScheduleHistoryItem As ScheduleHistoryItem)
            MyBase.New()
            Me.ScheduleHistoryItem = objScheduleHistoryItem
        End Sub

        Public Overrides Sub DoWork()
            Try
                ' Delete all visitors who haven't accessed a page for 5 minutes or more

                Dim con As New SqlConnection(ConfigurationManager.AppSettings("SiteSqlServer"))
                Dim cmd As New SqlCommand("BDB_DeleteCurrentVisitors", con)
                cmd.CommandType = CommandType.StoredProcedure

                Try
                    con.Open()
                    cmd.ExecuteNonQuery()
                    con.Close()
                Catch ex As Exception
                    If con.State = ConnectionState.Open Then
                        con.Close()
                    End If
                End Try


                ' then report success to the scheduler framework
                ScheduleHistoryItem.Succeeded = True

            Catch ex As Exception
                ' handle any exceptions

                ' report a failure
                ScheduleHistoryItem.Succeeded = False

                ' log the exception into
                ' the scheduler framework
                ScheduleHistoryItem.AddLogNote("EXCEPTION" + ex.ToString())

                ' call the Errored method
                Errored(ex)

                ' log the exception into the DNN core
                Exceptions.LogException(ex)

            End Try

        End Sub
    End Class
End Namespace


Then I created a new schedule item with DotNetNuke.Services.Scheduling.CurrentVisitorScheduledTask as full class name and DOTNETNUKE as assembly. Unfortunately the schedule never works, what am I missing here?


 

 
New Post
5/28/2009 8:13 PM
 

Can you see the SI in the Schedule Item list? I would get it working manually then try and create it with code.


Entrepreneur

PokerDIY Tournament Manager - PokerDIY Tournament Manager<
PokerDIY Game Finder - Mobile Apps powered by DNN
PokerDIY - Connecting Poker Players

 
New Post
5/29/2009 2:38 AM
 

Yes, I see the item in the Schedule Item list. But if I check the history of the item, no rows are shown.  Also, in 'View Schedule Status', my task is listed but 273,3518959  is filled in in the column Overdue(seconds) and nothing is filled in  in the column Time remaining (seconds).

 
New Post
5/29/2009 10:22 PM
 

So the way I debug Scheduler items is to put a breakpoint at the top and then stop and start the task - this makes it run - what happens when you do this?


Entrepreneur

PokerDIY Tournament Manager - PokerDIY Tournament Manager<
PokerDIY Game Finder - Mobile Apps powered by DNN
PokerDIY - Connecting Poker Players

 
New Post
6/2/2009 4:40 AM
 

Nothing happend unfortunately, but now I know why. The scheduler could not find the dll. I solved the matter by creating a seperate module and putting the compiled dll in the bin folder of the website. Now the schedule works perfectly.

 
Previous
 
Next
HomeHomeDevelopment and...Development and...DNN Platform (o...DNN Platform (o...Custom Scheduler wonCustom Scheduler won't work


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out