daily pastebin goal
15%
SHARE
TWEET

Untitled

a guest Oct 12th, 2018 64 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /**
  2.      * Retrieves non expired locks for this item.
  3.      * @returns  Enumerable with information about locks.
  4.      */
  5.     public async getActiveLocks(): Promise<LockInfo[]> {
  6.         const locks = await this.getLocks();
  7.         if (locks === null) {
  8.             return new Array<LockInfo>();
  9.         }
  10.  
  11.         const lockInfoList = locks.map(l => new LockInfo(
  12.             l.level,
  13.             l.isDeep,
  14.             l.lockToken,
  15.             l.expiration === (new Date(8640000000000000).getTime()) ?
  16.                 (new Date(8640000000000000).getTime()) :
  17.                 Math.ceil(l.expiration - Date.now()),
  18.             l.clientOwner,
  19.             l.lockRoot
  20.         ));
  21.  
  22.         return lockInfoList;
  23.     }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top