feat(desktop): refresh publish tasks instantly on lease activation
Emit a 'publish-task-lease' runtime invalidation event whenever the scheduler activates a publish task, and have PublishManagementView listen for it to trigger an immediate refresh. The view also switches to a 5s active-task poll only while a task is in_progress, replacing the unconditional 20s timer.
This commit is contained in:
@@ -84,7 +84,7 @@ import {
|
||||
notePublishTaskLeaseMiss,
|
||||
selectNextPublishTask,
|
||||
} from './publish-scheduler'
|
||||
import { onRuntimeInvalidated } from './runtime-events'
|
||||
import { emitRuntimeInvalidated, onRuntimeInvalidated } from './runtime-events'
|
||||
import {
|
||||
initScheduler,
|
||||
noteSchedulerAccountsSync,
|
||||
@@ -2426,6 +2426,7 @@ async function executeLeasedTask(
|
||||
noteMonitorTaskLeased(task, routing)
|
||||
} else {
|
||||
notePublishTaskActivated(taskRecord.id, taskRecord.platform)
|
||||
emitRuntimeInvalidated('publish-task-lease', { taskId: taskRecord.id })
|
||||
}
|
||||
syncSchedulerSurface()
|
||||
queueMicrotask(() => pumpExecutionLoop())
|
||||
|
||||
Reference in New Issue
Block a user