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:
@@ -145,11 +145,21 @@ const desktopBridge = {
|
||||
setWindowMode: (mode: 'login' | 'main', request?: WindowModeRequest) =>
|
||||
ipcRenderer.invoke('desktop:set-window-mode', mode, request) as Promise<null>,
|
||||
onRuntimeInvalidated: (
|
||||
listener: (event: { reason: 'account-health'; at: number; accountId?: string }) => void,
|
||||
listener: (event: {
|
||||
reason: 'account-health' | 'publish-task-lease'
|
||||
at: number
|
||||
accountId?: string
|
||||
taskId?: string
|
||||
}) => void,
|
||||
) => {
|
||||
const wrapped = (
|
||||
_event: IpcRendererEvent,
|
||||
payload: { reason: 'account-health'; at: number; accountId?: string },
|
||||
payload: {
|
||||
reason: 'account-health' | 'publish-task-lease'
|
||||
at: number
|
||||
accountId?: string
|
||||
taskId?: string
|
||||
},
|
||||
) => {
|
||||
listener(payload)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user