InitializeJobs will use current DateTime to setup new jobs (Prevents jobs running immediately for new installs).

This commit is contained in:
Mark McDowall 2011-11-30 18:23:22 -08:00
parent 4ddd1a0f6f
commit 6805a1041b
2 changed files with 4 additions and 2 deletions

View File

@ -239,7 +239,9 @@ namespace NzbDrone.Core.Test.ProviderTests.JobProviderTests
timers[0].Interval.Should().Be(fakeJob.DefaultInterval);
timers[0].Name.Should().Be(fakeJob.Name);
timers[0].TypeName.Should().Be(fakeJob.GetType().ToString());
timers[0].LastExecution.Should().HaveYear(2000);
timers[0].LastExecution.Should().HaveYear(DateTime.Now.Year);
timers[0].LastExecution.Should().HaveMonth(DateTime.Now.Month);
timers[0].LastExecution.Should().HaveDay(DateTime.Today.Day);
timers[0].Enable.Should().BeTrue();
}

View File

@ -90,7 +90,7 @@ namespace NzbDrone.Core.Providers.Jobs
TypeName = timer.GetType().ToString(),
Name = timerProviderLocal.Name,
Interval = timerProviderLocal.DefaultInterval,
LastExecution = new DateTime(2000, 1, 1)
LastExecution = DateTime.Now
};
SaveDefinition(settings);