{"id":37019555,"url":"https://github.com/yusufaytas/dlock","last_synced_at":"2026-01-14T02:10:41.810Z","repository":{"id":37285847,"uuid":"139051087","full_name":"yusufaytas/dlock","owner":"yusufaytas","description":"Interval Lock","archived":false,"fork":false,"pushed_at":"2025-09-13T17:41:14.000Z","size":96,"stargazers_count":24,"open_issues_count":0,"forks_count":8,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-09-13T19:31:23.496Z","etag":null,"topics":["interval","java","kotlin","lock","mysql","postgres","spring","spring-boot","timeout"],"latest_commit_sha":null,"homepage":"","language":"Java","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/yusufaytas.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":"2018-06-28T17:49:38.000Z","updated_at":"2025-09-13T17:41:12.000Z","dependencies_parsed_at":"2025-09-13T19:18:43.007Z","dependency_job_id":"f1918226-1880-4336-b9fe-f3c3891e946a","html_url":"https://github.com/yusufaytas/dlock","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/yusufaytas/dlock","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yusufaytas%2Fdlock","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yusufaytas%2Fdlock/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yusufaytas%2Fdlock/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yusufaytas%2Fdlock/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/yusufaytas","download_url":"https://codeload.github.com/yusufaytas/dlock/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yusufaytas%2Fdlock/sbom","scorecard":{"id":1237607,"data":{"date":"2025-07-28","repo":{"name":"github.com/yusufaytas/dlock","commit":"8d2b28d5cfddecb4b5357ac9b2fb887957aeed40"},"scorecard":{"version":"v5.2.1-26-g4feedb85","commit":"4feedb857ab8d82158aa9774bf8054df41992180"},"score":3.5,"checks":[{"name":"Code-Review","score":0,"reason":"Found 1/15 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/4feedb857ab8d82158aa9774bf8054df41992180/docs/checks.md#code-review"}},{"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/4feedb857ab8d82158aa9774bf8054df41992180/docs/checks.md#maintained"}},{"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/4feedb857ab8d82158aa9774bf8054df41992180/docs/checks.md#packaging"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/4feedb857ab8d82158aa9774bf8054df41992180/docs/checks.md#token-permissions"}},{"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/4feedb857ab8d82158aa9774bf8054df41992180/docs/checks.md#binary-artifacts"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/4feedb857ab8d82158aa9774bf8054df41992180/docs/checks.md#dangerous-workflow"}},{"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/4feedb857ab8d82158aa9774bf8054df41992180/docs/checks.md#cii-best-practices"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/4feedb857ab8d82158aa9774bf8054df41992180/docs/checks.md#pinned-dependencies"}},{"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/4feedb857ab8d82158aa9774bf8054df41992180/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/4feedb857ab8d82158aa9774bf8054df41992180/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/4feedb857ab8d82158aa9774bf8054df41992180/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/4feedb857ab8d82158aa9774bf8054df41992180/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":-1,"reason":"internal error: error during branchesHandler.setup: internal error: githubv4.Query: Resource not accessible by integration","details":null,"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/4feedb857ab8d82158aa9774bf8054df41992180/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 17 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/4feedb857ab8d82158aa9774bf8054df41992180/docs/checks.md#sast"}},{"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/4feedb857ab8d82158aa9774bf8054df41992180/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-09-13T19:32:27.767Z","repository_id":37285847,"created_at":"2025-09-13T19:32:27.767Z","updated_at":"2025-09-13T19:32:27.767Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28408711,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T01:52:23.358Z","status":"online","status_checked_at":"2026-01-14T02:00:06.678Z","response_time":107,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["interval","java","kotlin","lock","mysql","postgres","spring","spring-boot","timeout"],"created_at":"2026-01-14T02:10:41.232Z","updated_at":"2026-01-14T02:10:41.803Z","avatar_url":"https://github.com/yusufaytas.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"DLock\n========\n[![Apache License 2](https://img.shields.io/badge/license-ASF2-blue.svg)](https://www.apache.org/licenses/LICENSE-2.0.txt) [![Build Status](https://travis-ci.org/yusufaytas/dlock.png?branch=master)](https://travis-ci.org/yusufaytas/dlock)\n\nDLock is a library to get an interval lock. An Interval Lock is a lock where the acquirer acquires the lock for a certain amount of time. Once the lock is acquired, it won't be released till the interval ends. Note that, each of the Interval Lock implementations guarantees atomicity over processes and threads. The lock can only be acquired by only one process or thread at a time as expected. The implementations differ based on the technology.\n\nFeedback and pull-requests are welcome!\n+ [Usage](#usage)\n+ [Lock Implementations](#lock-implementations)\n  - [Postgres](#postgres)\n  - [MySQL](#mysql)\n+ [Contributing](#contributing)\n\n# Usage\n## Requirements and dependencies\n* Java 8\n* slf4j-api\n\nNote that, there should be only one global lock.\n\n## Import project\n#### maven\n```xml\n\u003cdependency\u003e\n    \u003cgroupId\u003ecom.yusufaytas\u003c/groupId\u003e\n    \u003cartifactId\u003edlock-spring\u003c/artifactId\u003e\n    \u003cversion\u003e0.2.1\u003c/version\u003e\n\u003c/dependency\u003e\n\u003cdependency\u003e\n    \u003cgroupId\u003ecom.yusufaytas\u003c/groupId\u003e\n    \u003cartifactId\u003edlock-jdbc\u003c/artifactId\u003e\n    \u003cversion\u003e0.2.1\u003c/version\u003e\n\u003c/dependency\u003e\n```\nor you can import all\n```xml\n\u003cdependency\u003e\n    \u003cgroupId\u003ecom.yusufaytas\u003c/groupId\u003e\n    \u003cartifactId\u003edlock-all\u003c/artifactId\u003e\n    \u003cversion\u003e0.2.1\u003c/version\u003e\n\u003c/dependency\u003e\n```\n#### gradle\n```groovy\ncompile 'com.yusufaytas:dlock-spring:0.2.1'\ncompile 'com.yusufaytas:dlock-jdbc:0.2.1'\n```\nor you can import all\n```groovy\ncompile 'com.yusufaytas:dlock-all:0.2.1'\n```\n## Add an Interval Lock Support\n#### Spring Bean Config\nAn example lock support for Postgres can be added as follows\n```xml\n\u003c!-- A bean for the lock implementation. Note that there should be only one global implementation--\u003e\n\u003cbean id=\"postgresLock\" class=\"com.yusufaytas.dlock.jdbc.PostgresIntervalLock\"\u003e\n  \u003cconstructor-arg type=\"javax.sql.DataSource\" ref=\"lockDataSource\"/\u003e\n\u003c/bean\u003e\n\u003c!-- The lock gets auto-registered to the registrar --\u003e\n\u003cbean id=\"lockRegistrar\" class=\"com.yusufaytas.dlock.spring.SpringLockRegistrar\"/\u003e\n```\n#### Java Code\n```java\n@Scheduled(cron = \"*/1 * * * * *\")\n@TryLock(name = \"example\", owner = \"dlock\", lockFor = ONE_MINUTE)\npublic void exampleLock() {\n  System.out.println(\"lock works\");\n}\n```\n# Lock Implementations\n## Jdbc\nYou need to execute the DDL at the target database with appropriate permissions to make the lock work.\n### Postgres\nWe insert into postgres if there doesn't exist a lock. Please checkout the [Postgres DDL](https://github.com/yusufaytas/dlock/blob/master/dlock-jdbc/src/main/resources/ddls/postgres.ddl).\n### MySQL\nWe get an exclusive lock on the lock table and insert a new lock if a conflicting lock doesn't exit. Please checkout the [MySQL DDL](https://github.com/yusufaytas/dlock/blob/master/dlock-jdbc/src/main/resources/ddls/mysql.ddl).\n# Contributing\n## Compiling project\n```shell script\n./mvnw clean install -Dgpg.skip\n```\n## License Header\n```shell script\n./mvnw license:format -Dgpg.skip\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyusufaytas%2Fdlock","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyusufaytas%2Fdlock","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyusufaytas%2Fdlock/lists"}