@@ -66,7 +66,7 @@ export class DynamoDBStore implements LockStore {
6666 }
6767
6868 /**
69- * Save a lock
69+ * Save the lock in the store if not already locked by another owner
7070 */
7171 async save ( key : string , owner : string , ttl : number | null ) {
7272 await this . #initialized
@@ -96,7 +96,8 @@ export class DynamoDBStore implements LockStore {
9696 }
9797
9898 /**
99- * Delete a lock
99+ * Delete the lock from the store if it is owned by the owner
100+ * Otherwise throws a E_LOCK_NOT_OWNED error
100101 */
101102 async delete ( key : string , owner : string ) {
102103 const command = new DeleteItemCommand ( {
@@ -115,9 +116,9 @@ export class DynamoDBStore implements LockStore {
115116 }
116117
117118 /**
118- * Force delete a lock
119+ * Force delete the lock from the store. No check is made on the owner
119120 */
120- async forceRelease ( key : string ) {
121+ async forceDelete ( key : string ) {
121122 const command = new DeleteItemCommand ( {
122123 TableName : this . #tableName,
123124 Key : { key : { S : key } } ,
@@ -127,7 +128,7 @@ export class DynamoDBStore implements LockStore {
127128 }
128129
129130 /**
130- * Check if a lock exists
131+ * Check if the lock exists
131132 */
132133 async exists ( key : string ) {
133134 await this . #initialized
@@ -142,6 +143,10 @@ export class DynamoDBStore implements LockStore {
142143 return result . Item !== undefined && ! isExpired
143144 }
144145
146+ /**
147+ * Extend the lock expiration. Throws an error if the lock is not owned by the owner
148+ * Duration is in milliseconds
149+ */
145150 async extend ( key : string , owner : string , duration : number ) {
146151 const command = new PutItemCommand ( {
147152 TableName : this . #tableName,
0 commit comments