Registry / utility / shedlock-core

shedlock-core

JSON →
library7.7.0javamavenunverified

Distributed lock for scheduled tasks in Java, ensuring only one instance executes a task at a time.

<dependency> <groupId>net.javacrumbs.shedlock</groupId> <artifactId>shedlock-core</artifactId> <version>7.7.0</version> </dependency>
INSTALL
IMPORT
SIG · SHEDLOCK-CORE
S
shedlock-core
utilityjavav7.7.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

SchedulerLock
net.javacrumbs.shedlock.core.SchedulerLock

Annotate a scheduled method with SchedulerLock

import net.javacrumbs.shedlock.core.SchedulerLock; public class MyTask { @SchedulerLock(name = "myTask", lockAtMostFor = "PT30S") public void run() { // task logic } }
Debug
Known issues
gotchaEnsure lockAtMostFor is set appropriately to avoid deadlocks.
fix
Set lockAtMostFor to a duration slightly longer than the maximum expected execution time.
affects: all
Upgrade
Version history
7.7.0latest on Maven
Audit
Dependencies

No dependency data recorded yet.

Agent activity
14 hits · last 30 days
node
14
Resources
shedlock-core — mvn dependency:get shedlock-core · libregistry