♻️ Update the usage counting since the pool id logic changed
This commit is contained in:
@@ -314,9 +314,20 @@ public class BroadcastEventHandler(
|
||||
logger.LogInformation("Uploaded file {FileId} done!", fileId);
|
||||
|
||||
var now = SystemClock.Instance.GetCurrentInstant();
|
||||
|
||||
var newReplica = new SnFileReplica
|
||||
{
|
||||
Id = Guid.NewGuid(),
|
||||
ObjectId = fileId,
|
||||
PoolId = destPool,
|
||||
StorageId = storageId,
|
||||
Status = SnFileReplicaStatus.Available,
|
||||
IsPrimary = false
|
||||
};
|
||||
scopedDb.FileReplicas.Add(newReplica);
|
||||
|
||||
await scopedDb.Files.Where(f => f.Id == fileId).ExecuteUpdateAsync(setter => setter
|
||||
.SetProperty(f => f.UploadedAt, now)
|
||||
.SetProperty(f => f.PoolId, destPool)
|
||||
);
|
||||
|
||||
await scopedDb.FileObjects.Where(fo => fo.Id == fileId).ExecuteUpdateAsync(setter => setter
|
||||
|
||||
@@ -54,7 +54,6 @@ public static class ServiceCollectionExtensions
|
||||
|
||||
public IServiceCollection AddAppBusinessServices()
|
||||
{
|
||||
services.AddScoped<Storage.FileMigrationService>();
|
||||
services.AddScoped<Storage.FileService>();
|
||||
services.AddScoped<Storage.FileReanalysisService>();
|
||||
services.AddScoped<Storage.PersistentTaskService>();
|
||||
|
||||
Reference in New Issue
Block a user