mirror of
https://github.com/gitui-org/gitui
synced 2026-05-23 17:08:21 +00:00
prevent stacking up more and more status requests (#156)
This commit is contained in:
parent
18c4d872d3
commit
51d17b2596
1 changed files with 12 additions and 2 deletions
|
|
@ -85,9 +85,19 @@ impl AsyncStatus {
|
|||
&mut self,
|
||||
params: StatusParams,
|
||||
) -> Result<Option<Status>> {
|
||||
if self.is_pending() {
|
||||
log::trace!("request blocked, still pending");
|
||||
return Ok(None);
|
||||
}
|
||||
|
||||
let hash_request = hash(¶ms);
|
||||
|
||||
log::trace!("request: [hash: {}]", hash_request);
|
||||
log::trace!(
|
||||
"request: [hash: {}] (type: {:?}, untracked: {})",
|
||||
hash_request,
|
||||
params.status_type,
|
||||
params.include_untracked,
|
||||
);
|
||||
|
||||
{
|
||||
let mut current = self.current.lock()?;
|
||||
|
|
@ -138,7 +148,7 @@ impl AsyncStatus {
|
|||
let res = Self::get_status(status_type, include_untracked)?;
|
||||
log::trace!(
|
||||
"status fetched: {} (type: {:?}, untracked: {})",
|
||||
hash(&res),
|
||||
hash_request,
|
||||
status_type,
|
||||
include_untracked
|
||||
);
|
||||
|
|
|
|||
Loading…
Reference in a new issue