qri-io / walk

Webcrawler/sitemapper
GNU General Public License v3.0
6 stars 2 forks source link

Coordinator doesn’t always automatically end when all work is done #14

Open Mr0grog opened 5 years ago

Mr0grog commented 5 years ago

Currently, running a crawl requires explicitly stopping walk when the crawl has completed by sending SIGINT with ctrl+c. It would be a huge improvement if the coordinator could reliably detect when all the items in its queue have been successfully processed by a worker, then stop.

The coordinator actually already has a structure for this: https://github.com/qri-io/walk/blob/5e8f3fe5e9da69d249b2c58a3a788c6722452dc5/lib/coordinator.go#L102-L128

(The right flags on a request in the RequestStore get triggered in the Completed() callback.)

But it has a few issues:

We also need tests to cover this better :)