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

Refactor retry logic for deployment key #152

Open
samyfodil opened this issue May 9, 2024 · 2 comments
Open

Refactor retry logic for deployment key #152

samyfodil opened this issue May 9, 2024 · 2 comments
Labels
good first issue No deep understanding of tau needed

Comments

@samyfodil
Copy link
Contributor

Sometimes, a build might be triggered before the repository is registered, which mean a deployment key was added. For these reason we have a retry logic here https://github.com/taubyte/tau/blob/main/protocols/monkey/job.go#L88. Frankly, this code does not look good.

I suggest moving the check for deployment key to https://github.com/taubyte/tau/blob/main/protocols/monkey/job.go#L41, and use a helper function that will retry for a number of times till we get repo with a deployment key.

@samyfodil samyfodil added the good first issue No deep understanding of tau needed label May 9, 2024
@mortum5
Copy link
Contributor

mortum5 commented May 22, 2024

How much Attempts and Delay do we need? Also can you describe it in more detail. Because i dont understand what workflow of logic should be followed.

@samyfodil
Copy link
Contributor Author

You can have the retry and wait as global variables

In L41 we fetch repo info. we should re-try there if no key is found. then move on with the logic.
Re-fetching in L81 is not necessary

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue No deep understanding of tau needed
Projects
None yet
Development

No branches or pull requests

2 participants