Rework jobs
This commit is contained in:
@@ -1,7 +0,0 @@
|
||||
namespace Musify.Application.Contracts.Application
|
||||
{
|
||||
public interface IEvent
|
||||
{
|
||||
Guid JobId { get; }
|
||||
}
|
||||
}
|
||||
@@ -15,9 +15,9 @@ namespace Musify.Application.Contracts.Infrastructure
|
||||
|
||||
DbSet<Upload> Uploads { get; }
|
||||
|
||||
DbSet<Job> Jobs { get; }
|
||||
DbSet<ProcessExecution> ProcessExecutions { get; }
|
||||
|
||||
DbSet<JobOperation> JobOperations { get; }
|
||||
DbSet<ProcessStepExecution> ProcessStepExecutions { get; }
|
||||
|
||||
Task<int> SaveChangesAsync(CancellationToken cancellationToken);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
using Musify.Domain.Entities;
|
||||
|
||||
namespace Musify.Application.Contracts.Infrastructure
|
||||
{
|
||||
public interface IProcessTrackingStore
|
||||
{
|
||||
Task<Guid> GetOrCreateProcessAsync(
|
||||
string processName,
|
||||
Guid? correlationId,
|
||||
Guid? conversationId,
|
||||
Guid? messageId,
|
||||
CancellationToken cancellationToken);
|
||||
|
||||
Task<Guid> StartStepAsync(
|
||||
Guid processExecutionId,
|
||||
string stepName,
|
||||
ProcessStepComponentType componentType,
|
||||
int attempt,
|
||||
CancellationToken cancellationToken);
|
||||
|
||||
Task CompleteStepAsync(Guid processExecutionId, Guid stepExecutionId, CancellationToken cancellationToken);
|
||||
|
||||
Task FailStepAsync(Guid processExecutionId, Guid stepExecutionId, string errorMessage, CancellationToken cancellationToken);
|
||||
}
|
||||
}
|
||||
@@ -3,7 +3,6 @@
|
||||
namespace Musify.Application.Events
|
||||
{
|
||||
public record RemoveFileEvent(
|
||||
Guid JobId,
|
||||
string BucketName,
|
||||
string KeyName) : IEvent;
|
||||
string KeyName);
|
||||
}
|
||||
@@ -70,7 +70,6 @@ namespace Musify.Application.PlayLists.Commands.DeletePlayList
|
||||
try
|
||||
{
|
||||
await eventBus.PublishAsync(new RemoveFileEvent(
|
||||
Guid.NewGuid(),
|
||||
storageConfiguration.BucketName,
|
||||
keyName), cancellationToken);
|
||||
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
using Ardalis.Result;
|
||||
using DispatchR.Abstractions.Send;
|
||||
using MassTransit;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using Musify.Application.Configuration;
|
||||
@@ -54,7 +53,6 @@ namespace Musify.Application.PlayLists.Commands.UpdatePlayList
|
||||
try
|
||||
{
|
||||
await eventBus.PublishAsync(new RemoveFileEvent(
|
||||
Guid.NewGuid(),
|
||||
storageConfiguration.BucketName,
|
||||
originalImageStorageKey), cancellationToken);
|
||||
}
|
||||
@@ -72,7 +70,6 @@ namespace Musify.Application.PlayLists.Commands.UpdatePlayList
|
||||
try
|
||||
{
|
||||
await eventBus.PublishAsync(new RemoveFileEvent(
|
||||
Guid.NewGuid(),
|
||||
storageConfiguration.BucketName,
|
||||
playList.SmallPictureKeyName), cancellationToken);
|
||||
}
|
||||
@@ -88,7 +85,6 @@ namespace Musify.Application.PlayLists.Commands.UpdatePlayList
|
||||
try
|
||||
{
|
||||
await eventBus.PublishAsync(new RemoveFileEvent(
|
||||
Guid.NewGuid(),
|
||||
storageConfiguration.BucketName,
|
||||
playList.MediumPictureKeyName), cancellationToken);
|
||||
}
|
||||
@@ -104,7 +100,6 @@ namespace Musify.Application.PlayLists.Commands.UpdatePlayList
|
||||
try
|
||||
{
|
||||
await eventBus.PublishAsync(new RemoveFileEvent(
|
||||
Guid.NewGuid(),
|
||||
storageConfiguration.BucketName,
|
||||
playList.LargePictureKeyName), cancellationToken);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user