-
Notifications
You must be signed in to change notification settings - Fork 302
long-running processes could emit "progress" events #667
Copy link
Copy link
Open
Description
Some RPC calls like wallet rescan return success: true right away even though from a UX perspective, the rescan has just begun:
Lines 189 to 201 in eea15c2
| this.post('/rescan', async (req, res) => { | |
| if (!req.admin) { | |
| res.json(403); | |
| return; | |
| } | |
| const valid = Validator.fromRequest(req); | |
| const height = valid.u32('height'); | |
| res.json(200, { success: true }); | |
| await this.wdb.rescan(height); | |
| }); |
Other RPC calls like the WIP dumpzone or pruneblockchain may timeout long before completion since the http timeout is only 5 seconds (from brq).
I was thinking we could establish a convention where these calls always return some kind of "in progress" message once initiated so they don't time out, and then the process itself can emit "progress" events that can either be listened to by the caller (i.e. bob wallet UI) or even from the command line similar to hsw-cli listen
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels