@@ -76,7 +76,8 @@ export interface ResolvedLockConfig {
7676
7777export interface LockStore {
7878 /**
79- * Save the lock in the store if not already locked by another owner
79+ * Save the lock in the store.
80+ * This method should return false if the given key is already locked
8081 *
8182 * @param key The key to lock
8283 * @param owner The owner of the lock
@@ -87,26 +88,27 @@ export interface LockStore {
8788 save ( key : string , owner : string , ttl : number | null ) : Promise < boolean >
8889
8990 /**
90- * Delete the lock from the store if it is owned by the owner
91- * Otherwise throws a E_LOCK_NOT_OWNED error
91+ * Delete the lock from the store if it is owned by the given owner
92+ * Otherwise should throws a E_LOCK_NOT_OWNED error
9293 *
9394 * @param key The key to delete
94- * @param owner The owner of the lock
95+ * @param owner The owner
9596 */
9697 delete ( key : string , owner : string ) : Promise < void >
9798
9899 /**
99- * Force delete the lock from the store. No check is made on the owner
100+ * Force delete the lock from the store without checking the owner
100101 */
101102 forceDelete ( key : string ) : Promise < void >
102103
103104 /**
104- * Check if the lock exists
105+ * Check if the lock exists. Returns true if so, false otherwise
105106 */
106107 exists ( key : string ) : Promise < boolean >
107108
108109 /**
109- * Extend the lock expiration. Throws an error if the lock is not owned by the owner
110+ * Extend the lock expiration. Throws an error if the lock is not owned by
111+ * the given owner
110112 * Duration is in milliseconds
111113 */
112114 extend ( key : string , owner : string , duration : number ) : Promise < void >
0 commit comments