Expand storage, transport, routing, agents, and messaging event bus modules
Add session bridge pair management, core replicator policy clear, drive mount unmount-all, relay tunnel bulk close, compact codec resetStats, peer bootstrap and noise session listing, graph and disk stripe clear, memetic clear, retry policy route management, bitfield drain, task orchestrator cancelAllPending, and distributed event bus topic/unsubscribe helpers. Co-authored-by: Cursor <[email protected]>
This commit is contained in:
@@ -363,6 +363,18 @@ class HyperP2PTaskOrchestrator extends EventEmitter {
|
||||
return [...this.tasks.keys()]
|
||||
}
|
||||
|
||||
async cancelAllPending (reason = 'bulk-cancel') {
|
||||
await this.ready()
|
||||
let n = 0
|
||||
for (const task of this.tasks.values()) {
|
||||
if (task.status === 'pending' || task.status === 'assigned') {
|
||||
await this.cancelTask(task.taskId, reason).catch(() => {})
|
||||
n++
|
||||
}
|
||||
}
|
||||
return n
|
||||
}
|
||||
|
||||
async queryTasks (filter = {}) {
|
||||
await this.ready()
|
||||
let results = Array.from(this.tasks.values())
|
||||
|
||||
Reference in New Issue
Block a user