Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FE]: Retry git push on error #62

Open
damsien opened this issue Jan 6, 2025 · 0 comments
Open

[FE]: Retry git push on error #62

damsien opened this issue Jan 6, 2025 · 0 comments
Labels
enhancement Request for enhancement

Comments

@damsien
Copy link
Collaborator

damsien commented Jan 6, 2025

Roadmap 2025/07 Retry when failed to push because of a locked mutex
As the DevOps of my team, I want to retry the push if an error occurred because the ref has been locked by another RemoteSyncer.

What to do

1. Add a retry time number argument

Provide a new retryNumber: int argument to the Push() function.

func (gp *GitPusher) Push() (GitPushResponse, error) {

This will be transmitted to the actual push function.

err = gp.pushChanges(repo)

2. Catch the lock error

If the git push error message contains "cannot lock ref", then call

gp.Push(retryNumber-1)

It will clone the repo with the data that have been added during the lock time.

3. Set the default retry number

When calling the function for the first time, set the retryNumber to 3 by default.

res, err := gitPusher.Push()

Additional context

If you have any questions, please tag @damsien.

@damsien damsien added the enhancement Request for enhancement label Jan 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Request for enhancement
Projects
None yet
Development

No branches or pull requests

1 participant