Skip to content

Create a user option for controlling automatic repo refreshes #4950

Closed

Description

@ptatian

Is your feature request related to a problem? Please describe.
I have an issue when GitHub Desktop tries to refresh repositories automatically. The refreshes seem to happen fairly often and, occasionally, at inconvenient times. This can slow up my work as the refreshes may take up to a minute to complete.

Describe the solution you'd like
A user option for controlling the frequency (eg, every 30 minutes) of automatic repository refreshes, or disabling automatic refreshes entirely, would help address this problem.

Describe alternatives you've considered
If the refreshes could be completed more quickly, that would also address this problem.

Teachability, Documentation, Adoption, Migration Strategy
Users will be able to set automatic refreshing to the frequency that works best for them, or just refresh manually, if they prefer.

Activity

  1. shiftkey commented on Jun 15, 2018

    @shiftkey
    Member

    @ptatian thanks for the feedback.

    The refreshes seem to happen fairly often and, occasionally, at inconvenient times.

    Background fetching is set to occur every 60mins, but might also be kicking in if you switch repositories often (when we setup the background fetcher). At the lower end, we skip a background fetch if we know you've fetched within the last 2 minutes, but maybe we can bump that up to something higher.

    // background fetching should not occur more than once every two minutes
    const BackgroundFetchMinimumInterval = 2 * 60 * 1000

    Users will be able to set automatic refreshing to the frequency that works best for them, or just refresh manually, if they prefer.

    This actually dovetails nicely with #1128 which has been an ongoing discussion for users who want to disable this completely.

  2. ptatian commented on Jun 15, 2018

    @ptatian
    Author

    Thank you, @shiftkey.

    Background fetching is set to occur every 60mins, but might also be kicking in if you switch repositories often...

    I wonder if it might also be triggered when I switch back to the Desktop from another app? (I'm working in Windows 7.) This could just be a coincidence, but it seems like the Desktop is often refreshing whenever I switch back to it from something else. (Which is partly why it is somewhat annoying.) I can try to be more mindful of when this is happening and report back if I note anything concrete, if that's helpful.

  3. shiftkey commented on Jun 15, 2018

    @shiftkey
    Member

    @ptatian the work that occurs when you re-focus on the app is explained here:

    ipcRenderer.on('focus', () => {
    const { selectedState } = appStore.getState()
    // Refresh the currently selected repository on focus (if
    // we have a selected repository).
    if (selectedState && selectedState.type === SelectionType.Repository) {
    dispatcher.refreshRepository(selectedState.repository)
    }
    dispatcher.setAppFocusState(true)
    })

    The work here should all be local-only, but you can read the function contents here:

    public async _refreshRepository(repository: Repository): Promise<void> {

    Let me know if you notice anything specific about the fetching on your setup.

  4. steveward commented on Nov 12, 2021

    @steveward
    Contributor

    Background fetching can now be disabled, so I believe this can be closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions