private static async Task ExecuteCommandAsync(BulkTaskCommand bulkCommand)
        {
            var(task, id, command) = bulkCommand;
            try
            {
                await task.Bus.PublishAsync(command);

                task.Results.Add(new BulkUpdateResultItem(id, task.JobIndex));
            }
            catch (Exception ex)
            {
                task.Results.Add(new BulkUpdateResultItem(id, task.JobIndex, ex));
            }
        }
Example #2
0
        private async Task ExecuteCommandAsync(BulkTaskCommand bulkCommand)
        {
            var(task, id, command) = bulkCommand;
            try
            {
                await task.Bus.PublishAsync(command);

                task.Results.Add(new BulkUpdateResultItem(id, task.JobIndex));
            }
            catch (Exception ex)
            {
                log.LogError(ex, "Faield to execute asset bulk job with index {index} of type {type}.",
                             task.JobIndex,
                             task.CommandJob.Type);

                task.Results.Add(new BulkUpdateResultItem(id, task.JobIndex, ex));
            }
        }
Example #3
0
        private async Task ExecuteCommandAsync(BulkTaskCommand bulkCommand)
        {
            var(task, id, command) = bulkCommand;
            try
            {
                await task.Bus.PublishAsync(command);

                task.Results.Add(new BulkUpdateResultItem(id, task.JobIndex));
            }
            catch (Exception ex)
            {
                log.LogError(ex, w => w
                             .WriteProperty("action", "BulkContent")
                             .WriteProperty("status", "Failed")
                             .WriteProperty("jobIndex", task.JobIndex)
                             .WriteProperty("jobType", task.CommandJob.Type.ToString()));

                task.Results.Add(new BulkUpdateResultItem(id, task.JobIndex, ex));
            }
        }
        private static async Task ExecuteCommandAsync(BulkTaskCommand bulkCommand)
        {
            var(task, id, command) = bulkCommand;

            Exception?exception = null;

            try
            {
                await task.Bus.PublishAsync(command);
            }
            catch (Exception ex)
            {
                exception = ex;
            }

            task.Results.Add(new BulkUpdateResultItem
            {
                Id        = id,
                JobIndex  = task.JobIndex,
                Exception = exception
            });
        }