bi01081993 / ncron

Automatically exported from code.google.com/p/ncron
Apache License 2.0
0 stars 0 forks source link

Bootstrap does not Load ServiceSetup #20

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1.Running the console app as instructed should call ServiceSetup which should 
run a Class as a job. NCron does not step into ServiceSetup which causes job 
not to run
Current version 2.1

Original issue reported on code.google.com by southpoi...@gmail.com on 9 Aug 2011 at 6:04

GoogleCodeExporter commented 8 years ago
Not real problem. Issue is bad error message. The system uses NCronTab's cron 
expression instead of standard cron expression so if you use the wrong syntax 
the system fails and does not render any good message, but this is so much 
better than Quartz.Net for most uses. Quarts.Net is too bloated.

Original comment by southpoi...@gmail.com on 10 Aug 2011 at 3:56

GoogleCodeExporter commented 8 years ago
I'm having this issue as well.  It doesn't look like ServiceSetup is being 
called at all.  Can you elaborate on how you diagnosed your issue and what you 
did about it?  I'm a bit stuck.

Original comment by MikeDam...@gmail.com on 4 Jun 2012 at 3:49

GoogleCodeExporter commented 8 years ago
Make sure you are using cronTab expressions  and not traditional Cron 
Expressions.
 http://code.google.com/p/ncrontab/wiki/CrontabExpression

Set it to run every minutes for testing.
e.g.

static void Main(string[] args)
        {

            Bootstrap.Init(args, ServiceSetup);
        }
        static void ServiceSetup(SchedulingService service)
        {
            service.At("* * * * *").Run<OverDueProjectsJob>();
            service.At("* * * * *").Run<TasksComingDueJob>();
            service.At("* * * * *").Run<OverDueTasksJob>();

        }

Original comment by southpoi...@gmail.com on 4 Jun 2012 at 4:11

GoogleCodeExporter commented 8 years ago
Alright.  I don't think your issue is related to mine, then.  I'm scheduling 
one service currently (it's a HelloWorld project, basically), and it's done 
using service.Hourly().

I also placed logging statements before and after Bootstrap.Init in the Main 
block as well as the in the beginning of the ServiceSetup method.  The logging 
statements in the Main block execute.  The ServiceSetup logging statement does 
not.

I'm very confused...

Original comment by MikeDam...@gmail.com on 4 Jun 2012 at 6:07

GoogleCodeExporter commented 8 years ago
Having a similar issue except the application isn't making it past compilation.

The following code:

namespace Scheduling
{
    class Program
    {
        static void Main(string[] args)
        {
            Bootstrap.Init(args, ServiceSetup);
        }

        static void ServiceSetup(SchedulingService service)
        { }
    }
}

results in the error message:

Error   1   The best overloaded method match for 
'NCron.Service.Bootstrap.Init(string[], 
System.Action<NCron.Service.ISchedulingService>)' has some invalid 
arguments   D:\development\VisualStudio\dev\Prototype\Scheduling\Program.cs 17  13  
Scheduling

Which seems odd since SchedulingService does implement the ISchedulingService 
interface.

Original comment by colin.ha...@gmail.com on 1 Jun 2013 at 4:34