Advertisement
Guest User

Untitled

a guest
May 23rd, 2018
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.91 KB | None | 0 0
  1. const [assetTable, pairTable] = await Promise.all([
  2. this.getDatabase.findDocumentById("assetTable", config.name),
  3. this.getDatabase.findDocumentById("pairTable", config.name)
  4. ]);
  5. const keys = Object.keys(pairTable.assets);
  6. var shouldRemovePair = false;
  7. try {
  8. await Promise.all(keys.map(async key => {
  9. const separatePair = await splitPair(pairTable.assets[key], assetTable.assets);
  10. var ticker = await myUtil.retryCall(() => this.getTickerFor(separatePair[0], separatePair[1]), 200, 8);
  11. if (ticker.low === 0 && ticker.high === 0 && ticker.last === 0) {
  12. console.log("Deleted: ", key);
  13. delete pairTable.assets[key];
  14. shouldRemovePair = true;
  15. }
  16. else
  17. data.assets[key] = ticker;
  18. }));
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement