dag/completion: debounce GitLogCompletionModel updates
Gather paths using a background thread to avoid locking up the UI
during startup. Prevent updates that are in close succession from
retriggering the same path gathering operation.
This happens during startup because both the "refs_updated" and
the "updated" signal from the model trigger the "model_updated"
signal in the completion model. Both of these signals are
emitted during application startup when the model is first
updated.
This causes gather_paths() to be called twice, once for each
model signal, which is wasteful and slows down startup.
Use a time-based guard to prevent background tasks from
being spawned when there paths are already being gathered.
Signed-off-by: David Aguilar <davvid@gmail.com>