Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const [assetTable, pairTable] = await Promise.all([
- this.getDatabase.findDocumentById("assetTable", config.name),
- this.getDatabase.findDocumentById("pairTable", config.name)
- ]);
- const keys = Object.keys(pairTable.assets);
- var shouldRemovePair = false;
- try {
- await Promise.all(keys.map(async key => {
- const separatePair = await splitPair(pairTable.assets[key], assetTable.assets);
- var ticker = await myUtil.retryCall(() => this.getTickerFor(separatePair[0], separatePair[1]), 200, 8);
- if (ticker.low === 0 && ticker.high === 0 && ticker.last === 0) {
- console.log("Deleted: ", key);
- delete pairTable.assets[key];
- shouldRemovePair = true;
- }
- else
- data.assets[key] = ticker;
- }));
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement