[backend] Switch params methods to IEnumerable<T>
This commit is contained in:
parent
b49be2f904
commit
6c76b2b2c5
4 changed files with 5 additions and 5 deletions
|
@ -31,7 +31,7 @@ public class ActivityDeliverService(
|
||||||
// @formatter:on
|
// @formatter:on
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task DeliverToAsync(ASActivity activity, User actor, params User[] recipients)
|
public async Task DeliverToAsync(ASActivity activity, User actor, params IEnumerable<User> recipients)
|
||||||
{
|
{
|
||||||
logger.LogDebug("Queuing deliver-to-recipients jobs for activity {id}", activity.Id);
|
logger.LogDebug("Queuing deliver-to-recipients jobs for activity {id}", activity.Id);
|
||||||
if (activity.Actor == null) throw new Exception("Actor must not be null");
|
if (activity.Actor == null) throw new Exception("Actor must not be null");
|
||||||
|
|
|
@ -93,7 +93,7 @@ public class BackgroundTaskQueue(int parallelism)
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
var storageSvc = scope.GetRequiredService<ObjectStorageService>();
|
var storageSvc = scope.GetRequiredService<ObjectStorageService>();
|
||||||
await storageSvc.RemoveFilesAsync(paths.Where(p => p != null).Select(p => p!).ToArray());
|
await storageSvc.RemoveFilesAsync(paths.Where(p => p != null).Select(p => p!));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -152,7 +152,7 @@ public class BackgroundTaskQueue(int parallelism)
|
||||||
var rendered = await noteRenderer.RenderAsync(note);
|
var rendered = await noteRenderer.RenderAsync(note);
|
||||||
var activity = ActivityPub.ActivityRenderer.RenderUpdate(rendered, actor);
|
var activity = ActivityPub.ActivityRenderer.RenderUpdate(rendered, actor);
|
||||||
|
|
||||||
await deliverSvc.DeliverToAsync(activity, note.User, voters.ToArray());
|
await deliverSvc.DeliverToAsync(activity, note.User, voters);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -710,7 +710,7 @@ public class NoteService(
|
||||||
// @formatter:on
|
// @formatter:on
|
||||||
|
|
||||||
if (note.Visibility == Note.NoteVisibility.Specified)
|
if (note.Visibility == Note.NoteVisibility.Specified)
|
||||||
await deliverSvc.DeliverToAsync(activity, note.User, recipients.ToArray());
|
await deliverSvc.DeliverToAsync(activity, note.User, recipients);
|
||||||
else
|
else
|
||||||
await deliverSvc.DeliverToFollowersAsync(activity, note.User, recipients);
|
await deliverSvc.DeliverToFollowersAsync(activity, note.User, recipients);
|
||||||
}
|
}
|
||||||
|
|
|
@ -120,7 +120,7 @@ public class ObjectStorageService(IOptions<Config.StorageSection> config, HttpCl
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task RemoveFilesAsync(params string[] filenames)
|
public async Task RemoveFilesAsync(params IEnumerable<string> filenames)
|
||||||
{
|
{
|
||||||
if (_bucket == null)
|
if (_bucket == null)
|
||||||
throw new Exception("Refusing to remove file from object storage with invalid configuration");
|
throw new Exception("Refusing to remove file from object storage with invalid configuration");
|
||||||
|
|
Loading…
Add table
Reference in a new issue