refactor: simplify export metadata construction

This commit is contained in:
Gary Sharp
2025-02-07 16:10:15 +11:00
parent 67f1c2a5d1
commit 2fce645066
30 changed files with 1432 additions and 1484 deletions
+4 -4
View File
@@ -9,15 +9,15 @@ namespace Disco.Services.Exporting
{
public class ExportTask : ScheduledTask
{
private IExportContext context;
private IExport context;
public override string TaskName { get => context?.Name ?? "Exporting"; }
public override bool SingleInstanceTask { get { return false; } }
public override bool CancelInitiallySupported { get { return false; } }
public static ExportTaskContext ScheduleNow(IExportContext exportContext)
public static ExportTaskContext ScheduleNow(IExport export)
{
// Build Context
var taskContext = new ExportTaskContext(exportContext);
var taskContext = new ExportTaskContext(export);
// Build Data Map
var task = new ExportTask();
@@ -31,7 +31,7 @@ namespace Disco.Services.Exporting
private static string GetCacheKey(Guid exportId) => $"ExportTask_{exportId}";
public static ExportTaskContext ScheduleNowCacheResult(IExportContext exportContext, Func<Guid, string> returnUrlBuilder)
public static ExportTaskContext ScheduleNowCacheResult(IExport exportContext, Func<Guid, string> returnUrlBuilder)
{
var taskContext = ScheduleNow(exportContext);