Merge remote-tracking branch 'origin/dynamic-jobs'

This commit is contained in:
Mark McDowall 2012-10-19 08:39:07 -07:00
commit db585b3bd7
52 changed files with 292 additions and 208 deletions

View file

@ -145,13 +145,12 @@ namespace NzbDrone.Core.Jobs
logger.Trace("{0} Scheduled tasks have been added to the queue", pendingJobTypes.Count);
}
public virtual void QueueJob(Type jobType, int targetId = 0, int secondaryTargetId = 0, JobQueueItem.JobSourceType source = JobQueueItem.JobSourceType.User)
public virtual void QueueJob(Type jobType, dynamic options = null, JobQueueItem.JobSourceType source = JobQueueItem.JobSourceType.User)
{
var queueItem = new JobQueueItem
{
JobType = jobType,
TargetId = targetId,
SecondaryTargetId = secondaryTargetId,
Options = options,
Source = source
};
@ -277,7 +276,7 @@ namespace NzbDrone.Core.Jobs
var sw = Stopwatch.StartNew();
_notificationProvider.Register(_notification);
jobImplementation.Start(_notification, queueItem.TargetId, queueItem.SecondaryTargetId);
jobImplementation.Start(_notification, queueItem.Options);
_notification.Status = ProgressNotificationStatus.Completed;
settings.LastExecution = DateTime.Now;
@ -303,7 +302,7 @@ namespace NzbDrone.Core.Jobs
}
//Only update last execution status if was triggered by the scheduler
if (queueItem.TargetId == 0)
if (queueItem.Options == null)
{
SaveDefinition(settings);
}