{"id":17826380,"url":"https://github.com/arsham/retry","last_synced_at":"2026-01-11T04:01:27.686Z","repository":{"id":44624027,"uuid":"280845097","full_name":"arsham/retry","owner":"arsham","description":"Retry a function until is succeeds","archived":false,"fork":false,"pushed_at":"2024-06-17T19:52:24.000Z","size":79,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-02T21:42:49.656Z","etag":null,"topics":["go","golang","golang-library"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/arsham.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-07-19T10:47:23.000Z","updated_at":"2024-06-17T19:52:26.000Z","dependencies_parsed_at":"2024-06-19T02:44:47.357Z","dependency_job_id":null,"html_url":"https://github.com/arsham/retry","commit_stats":{"total_commits":25,"total_committers":1,"mean_commits":25.0,"dds":0.0,"last_synced_commit":"39b40b5e420c3eda11b3d355ca269c9bfa5ee710"},"previous_names":[],"tags_count":14,"template":false,"template_full_name":null,"purl":"pkg:github/arsham/retry","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arsham%2Fretry","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arsham%2Fretry/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arsham%2Fretry/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arsham%2Fretry/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/arsham","download_url":"https://codeload.github.com/arsham/retry/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arsham%2Fretry/sbom","scorecard":{"id":208679,"data":{"date":"2025-08-11","repo":{"name":"github.com/arsham/retry","commit":"9d12baab3d38a429440b17014cadc61dddbe0cc6"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.4,"checks":[{"name":"Code-Review","score":0,"reason":"Found 0/23 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/go.yml:28: update your workflow using https://app.stepsecurity.io/secureworkflow/arsham/retry/go.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/go.yml:31: update your workflow using https://app.stepsecurity.io/secureworkflow/arsham/retry/go.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/go.yml:39: update your workflow using https://app.stepsecurity.io/secureworkflow/arsham/retry/go.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/go.yml:50: update your workflow using https://app.stepsecurity.io/secureworkflow/arsham/retry/go.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/go.yml:53: update your workflow using https://app.stepsecurity.io/secureworkflow/arsham/retry/go.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/go.yml:61: update your workflow using https://app.stepsecurity.io/secureworkflow/arsham/retry/go.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/go.yml:67: update your workflow using https://app.stepsecurity.io/secureworkflow/arsham/retry/go.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/go.yml:70: update your workflow using https://app.stepsecurity.io/secureworkflow/arsham/retry/go.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/go.yml:75: update your workflow using https://app.stepsecurity.io/secureworkflow/arsham/retry/go.yml/master?enable=pin","Info:   0 out of   6 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   3 third-party GitHubAction dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/go.yml:1","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: Apache License 2.0: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 7 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-17T00:18:55.562Z","repository_id":44624027,"created_at":"2025-08-17T00:18:55.562Z","updated_at":"2025-08-17T00:18:55.562Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28280294,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-11T03:48:11.750Z","status":"ssl_error","status_checked_at":"2026-01-11T03:48:02.765Z","response_time":60,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["go","golang","golang-library"],"created_at":"2024-10-27T18:45:04.703Z","updated_at":"2026-01-11T04:01:27.663Z","avatar_url":"https://github.com/arsham.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Retry\n\n[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)\n![GitHub go.mod Go version](https://img.shields.io/github/go-mod/go-version/arsham/retry)\n[![go.dev reference](https://img.shields.io/badge/godoc-reference-5272B4)](https://pkg.go.dev/github.com/arsham/retry?tab=doc)\n[![Build Status](https://github.com/arsham/retry/actions/workflows/go.yml/badge.svg)](https://github.com/arsham/retry/actions/workflows/go.yml)\n[![Coverage Status](https://codecov.io/gh/arsham/retry/branch/master/graph/badge.svg)](https://codecov.io/gh/arsham/retry)\n[![Go Report Card](https://goreportcard.com/badge/github.com/arsham/retry)](https://goreportcard.com/report/github.com/arsham/retry)\n\nThis library supports `Go \u003e= 1.22` by getting `github.com/arsham/retry/v3`. For\nolder versions (`Go \u003e= 1.20`) import `github.com/arsham/retry/v2`, or older Go\nversions import `github.com/arsham/retry`.\n\n`Retry` calls your function, and if it errors it calls it again with a delay.\nEventually it returns the last error or nil if one call is successful.\n\n```go\nr := \u0026retry.Retry{\n\tAttempts: 666,\n\tDelay:    time.Millisecond,\n}\nerr := r.Do(func() error {\n\t// do some work.\n\treturn nil\n})\n```\n\nYou can provide multiple functions:\n\n```go\nerr := r.Do(func() error {\n    return nil\n}, func() error {\n    return nil\n}}\n```\n\nYou can use the `DoContext` and pass a context object to stop when the context\nis cancelled:\n\n```go\nerr := r.DoContext(ctx, func() error {\n\treturn nil\n})\n```\n\nIf you want to stop retrying you can return a special error:\n\n```go\nerr := r.Do(func() error {\n\tif specialCase {\n\t\treturn \u0026retry.StopError{\n\t\t\tErr: errors.New(\"a special stop\"),\n\t\t}\n\t}\n\treturn nil\n})\n```\n\nThe standard behaviour is to delay the amount you set. You can pass any function\nwith this signature to change the delay behaviour:\n\n```go\nfunc(attempt int, delay time.Duration) time.Duration\n```\n\nYou can also pass the `retry.IncrementalDelay` function that would increase the\ndelay with a jitter to prevent [Thundering\nherd](https://en.wikipedia.org/wiki/Thundering_herd_problem).\n\n```go\nr := \u0026retry.Retry{\n\tAttempts: 666,\n\tDelay:    10 * time.Millisecond,\n\tMethod:   retry.IncrementalDelay,\n}\nerr := r.Do(func() error {\n\tif specialCase {\n\t\treturn \u0026retry.StopError{\n\t\t\tErr: errors.New(\"a special stop\"),\n\t\t}\n\t}\n\treturn nil\n})\n```\n\n## License\n\nUse of this source code is governed by the Apache 2.0 license. License can be\nfound in the [LICENSE](./LICENSE) file.\n\n\u003c!--\nvim: foldlevel=1\n--\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farsham%2Fretry","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Farsham%2Fretry","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farsham%2Fretry/lists"}