Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Message from discussion Scheduled Job Only Runs the First Time (should be every 24hrs.)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Nuno Maia  
View profile  
 More options Mar 19 2012, 6:03 pm
From: Nuno Maia <nmsm...@gmail.com>
Date: Mon, 19 Mar 2012 22:03:07 +0000
Local: Mon, Mar 19 2012 6:03 pm
Subject: Re: [quartznet:2956] Scheduled Job Only Runs the First Time (should be every 24hrs.)
I think your issue is in scope of variable sched, use a Singleton
pattern for it.
On Mon, Mar 19, 2012 at 5:08 PM, Will Lingard <wlingar...@gmail.com> wrote:
> Hi Group,

> My first post in here, hoping perhaps someone can help out a little.

> I've started using Quartz recently and got things setup and working. I
> can schedule and run a job, however when I setup the Trigger to run
> every 24 hours, it runs on create and then never again.

> My code below.... any help much appreciated; thanks.

> Best Regards,

> Will

> ==========================================================

>        ''' <summary>
>        ''' Schedule Local Job
>        ''' </summary>
>        ''' <param name="jobType"></param>
>        ''' <param name="dataMap"></param>
>        ''' <remarks></remarks>
>        Protected Sub ScheduleLocalJob(ByVal jobType As Type, ByVal
> dataMap As JobDataMap, ByVal name As String, ByVal group As String,
> Optional ByVal oneTimeJob As Boolean = False)

>            Try

>                Dim sf As ISchedulerFactory = New
> StdSchedulerFactory()
>                Dim sched As IScheduler = sf.GetScheduler()

>                If sched.CheckExists(New JobKey(name, group)) Then
>                    sched.DeleteJob(New JobKey(name, group))
>                End If

>                sched.Start()

>                Dim jobDetail As IJobDetail =
> JobBuilder.Create().OfType(jobType).WithIdentity(New JobKey(name,
> group)).UsingJobData(dataMap).StoreDurably().Build()

>                Dim trigger As ITrigger
>                If oneTimeJob Then
>                    trigger =
> TriggerBuilder.Create().ForJob(jobDetail).WithIdentity(New
> TriggerKey(name,
> group)).WithSchedule(SimpleScheduleBuilder.Create()).StartNow().Build()
>                Else
>                    trigger =
> TriggerBuilder.Create().ForJob(jobDetail).WithIdentity(New
> TriggerKey(name,
> group)).WithSchedule(SimpleScheduleBuilder.Create().WithIntervalInHours(24) .RepeatForever()).StartNow().Build()
>                End If

>                sched.ScheduleJob(jobDetail, trigger)

>            Catch ex As Exception

>                DisplaySavedSuccessOrFail(False, ex.Message)

>            End Try

>        End Sub
>        '//-->

> ==========================================================

> --
> You received this message because you are subscribed to the Google Groups "Quartz.NET" group.
> To post to this group, send email to quartznet@googlegroups.com.
> To unsubscribe from this group, send email to quartznet+unsubscribe@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/quartznet?hl=en.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.