Skip to content
This repository has been archived by the owner on Nov 1, 2022. It is now read-only.

Make sync run immediately once git is ready #1060

Merged
merged 1 commit into from
May 8, 2018
Merged

Make sync run immediately once git is ready #1060

merged 1 commit into from
May 8, 2018

Conversation

squaremo
Copy link
Member

@squaremo squaremo commented Apr 27, 2018

Now that git mirroring is done in its own goroutine, something has to
trigger the sync loop to do a sync. A "cell" (channel with buffer size 1) is used to prompt the sync loop every time the repo fetches from
upstream.

However, this only happens git-poll-interval after the mirroring
has started, and most of the time when the sync loop starts, the git
repo isn't ready. That means the first successful sync, for a
freshly-configured fluxd, is usually five minutes after starting.

To compensate, this commit makes the repo signal on the cell when it
moves to the ready state.

Now that git mirroring is done in its own goroutine, something has to
trigger the sync loop to do a sync. A "cell" (channel with buffer size
1) is used to prompt the sync loop every time the repo fetches from
upstream.

However, this only happens `git-poll-interval` _after_ the mirroring
has started, and most of the time when the sync loop starts, the git
repo isn't ready. That means the first successful sync, for a
freshly-configured fluxd, is usually five minutes after starting.

To compensate, this commit makes the repo signal on the cell when it
moves to the ready state.
@squaremo squaremo requested a review from samb1729 May 8, 2018 10:03
@squaremo squaremo merged commit f9ff1ea into master May 8, 2018
@squaremo squaremo deleted the sync-sooner branch May 8, 2018 12:19
@squaremo
Copy link
Member Author

squaremo commented May 8, 2018

Thanks Sam ❇️

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants