Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * Retrieves non expired locks for this item.
- * @returns Enumerable with information about locks.
- */
- public async getActiveLocks(): Promise<LockInfo[]> {
- const locks = await this.getLocks();
- if (locks === null) {
- return new Array<LockInfo>();
- }
- const lockInfoList = locks.map(l => new LockInfo(
- l.level,
- l.isDeep,
- l.lockToken,
- l.expiration === (new Date(8640000000000000).getTime()) ?
- (new Date(8640000000000000).getTime()) :
- Math.ceil(l.expiration - Date.now()),
- l.clientOwner,
- l.lockRoot
- ));
- return lockInfoList;
- }
Add Comment
Please, Sign In to add comment