Exemplo n.º 1
0
        // Enqueue a background job with single notification object for all given options
        public static IndexProgressPushNotification Enqueue(string currentUserName, IndexingOptions[] options)
        {
            var notification = IndexProgressHandler.CreateNotification(currentUserName, null);

            BackgroundJob.Enqueue <IndexingJobs>(j => j.IndexAllDocumentsJob(currentUserName, notification.Id, options));
            return(notification);
        }
        // Enqueue a background job with single notification object for all given options
        public static IndexProgressPushNotification Enqueue(string currentUserName, IndexingOptions[] options)
        {
            var notification = IndexProgressHandler.CreateNotification(currentUserName, null);

            // Hangfire will set cancellation token.
            BackgroundJob.Enqueue <IndexingJobs>(j => j.IndexAllDocumentsJob(currentUserName, notification.Id, options, JobCancellationToken.Null));

            return(notification);
        }