Skip to content

Commit

Permalink
patch
Browse files Browse the repository at this point in the history
  • Loading branch information
waynebruce0x committed Jul 7, 2023
1 parent 7c3bc74 commit 9bb009a
Showing 1 changed file with 14 additions and 6 deletions.
20 changes: 14 additions & 6 deletions coins/src/storeCoins.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
require("dotenv").config();
import adapters from "./adapters/index";
import { batchWriteWithAlerts } from "./adapters/utils/database";
import {
batchWriteWithAlerts,
// batchWrite2WithAlerts,
} from "./adapters/utils/database";
import { filterWritesWithLowConfidence } from "./adapters/utils/database";
import { sendMessage } from "./../../defi/src/utils/discord";

Expand All @@ -27,10 +30,15 @@ export default async function handler(event: any) {
results.flat(),
);
for (let i = 0; i < resultsWithoutDuplicates.length; i += step) {
await batchWriteWithAlerts(
resultsWithoutDuplicates.slice(i, i + step),
true,
);
await Promise.all([
batchWriteWithAlerts(
resultsWithoutDuplicates.slice(i, i + step),
true,
),
// await batchWrite2WithAlerts(
// resultsWithoutDuplicates.slice(i, i + step),
// ),
]);
}
console.log(`${a[i][0]} done`);
} catch (e) {
Expand All @@ -50,7 +58,7 @@ export default async function handler(event: any) {
);
}

// ts-node coins/src/storeCoins.ts
// ts-node src/storeCoins.ts
async function main() {
let a = {
protocolIndexes: [0],
Expand Down

0 comments on commit 9bb009a

Please sign in to comment.