Repository navigation
use FETCH_HEAD timestamp to avoid excessive background fetching - #3403
Conversation
joshaber
left a comment
There was a problem hiding this comment.
I think this logic belongs in the BackgroundFetcher instead of here 🤔
That's where I initially started with this, but the dependency on I'll ponder on this some more, maybe there's some moving around we can do here... |
|
This is maybe a terrible idea, but it wouldn't bother me to store the last fetched time in Alternatively, |
I like this approach. Should be doable. |
|
🍎 |
joshaber
left a comment
There was a problem hiding this comment.
This looks good, just one nit about pulling a constant up.
|
|
||
| const now = new Date() | ||
| const timeSinceFetch = now.getTime() - lastFetched.getTime() | ||
| const twoMinutes = 2 * 60 * 1000 |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
|
🐕 |
Fixes #3329 for those who will switch repositories regularly by using the last fetched timestamp (which git updates using
.git/FETCH_HEADand we track in the app) and ignoring any background fetching for two minutes (chosen arbitrarily).