{"id":20760384,"url":"https://github.com/vanng822/gorlock","last_synced_at":"2026-04-24T10:05:37.238Z","repository":{"id":57538857,"uuid":"65421746","full_name":"vanng822/gorlock","owner":"vanng822","description":"Redis Lock wrapper for running distributed tasks","archived":false,"fork":false,"pushed_at":"2025-12-15T20:06:45.000Z","size":70,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-12-25T22:30:43.463Z","etag":null,"topics":["go","redis-lock"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/vanng822.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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2016-08-10T22:55:23.000Z","updated_at":"2025-12-15T20:04:13.000Z","dependencies_parsed_at":"2025-01-18T05:26:03.308Z","dependency_job_id":"0131e0cf-e6cd-4424-9ce6-5a727b739c0d","html_url":"https://github.com/vanng822/gorlock","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"purl":"pkg:github/vanng822/gorlock","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vanng822%2Fgorlock","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vanng822%2Fgorlock/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vanng822%2Fgorlock/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vanng822%2Fgorlock/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vanng822","download_url":"https://codeload.github.com/vanng822/gorlock/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vanng822%2Fgorlock/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32218302,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-24T09:47:08.147Z","status":"ssl_error","status_checked_at":"2026-04-24T09:46:41.165Z","response_time":64,"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","redis-lock"],"created_at":"2024-11-17T10:13:24.485Z","updated_at":"2026-04-24T10:05:37.215Z","avatar_url":"https://github.com/vanng822.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# gorlock\n\nRedis Lock wrapper for running distributed tasks. You can customize settings or configure and manage own redis client.\n\n# Usage\n\n```go\n  import (\n    \"fmt\"\n    \n    \"github.com/vanng822/gorlock\"\n  )\n  // using default instance\n  gorlock.Run(\"somekey\", func() error {\n    fmt.Println(\"Doing some job\")\n    return nil\n  })\n```\n\nOr\n\n```go\n  import (\n    \"fmt\"\n    \n    \"github.com/vanng822/gorlock\"\n  )\n  // using default instance with LockWaiting=true\n  gorlock.RunWaiting(\"somekey\", func() error {\n    fmt.Println(\"Doing some job\")\n    return nil\n  })\n```\n\nOr\n\n```go\n  import (\n    \"fmt\"\n    \n    \"github.com/vanng822/gorlock\"\n  )\n\n  // setting up own config/settings\n  redisConfig := gorlock.RedisConfig{\n    Address:        \"localhost:6379\",\n    Database:       0,\n    ConnectTimeout: 3 * time.Second,\n  }\n\n  waitingSettings := gorlock.Settings{\n    KeyPrefix:     \"gorlock\",\n    LockTimeout:   10 * time.Second,\n    LockWaiting:   true,\n    RetryTimeout:  3 * time.Second,\n    RetryInterval: 100 * time.Millisecond,\n  }\n  \n  lock := gorlock.New(\u0026waitingSettings, \u0026redisConfig)\n\n  // Wait for the lock if it is already locked due to LockWaiting=true\n  lock.Run(\"somekey\", func() error {\n    fmt.Println(\"Doing some job\")\n    return nil\n  })\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvanng822%2Fgorlock","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvanng822%2Fgorlock","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvanng822%2Fgorlock/lists"}