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

Add the agent-cache-refresher on the explorer backend #170

Closed
wants to merge 4 commits into from

Conversation

dsmello
Copy link

@dsmello dsmello commented Sep 6, 2024

Description:

Add a small Golang application that contains all the logic needed to trigger the cache refresh.

Motivation:

  • This will help avoid relying on a shell script to manage a production component.
  • All components will be together, preventing version mismatches across multiple repositories.

@dsmello dsmello self-assigned this Sep 6, 2024
func main() {
app := cli.NewApp()
app.Name = "cache-agent-refresh"
app.Version = fmt.Sprintf("%s, commit '%s', branch '%s'", version, commit, branch)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tiny nit: instead '%s' you should probably use %q.

app.Flags = flags
app.Writer = os.Stderr

app.Action = func(ctx *cli.Context) error {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would improve the readability if you would extract this whole block as a normal named function.

max_interval_circulation int = 30 // 30 minutes

// App settings
// metricsPortFlag string.
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Commented code left.

return int(math.Floor(float64(current_layer) / float64(leyers_per_epoch)))
}

func prometheus_metrics_parcer(prometheus_metric_scrape, metric_name, label_value string) float64 {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typo? should that be "parser"?

@kacpersaw kacpersaw closed this Sep 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants