Skip to content

Commit

Permalink
DB timestamps
Browse files Browse the repository at this point in the history
  • Loading branch information
waynebruce0x committed Jul 7, 2023
1 parent 0b5df9d commit 7c3bc74
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion coins/src/adapters/utils/database.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import {
} from "./dbInterfaces";
import { contracts } from "../other/distressedAssets";
import { sendMessage } from "./../../../../defi/src/utils/discord";

import { batchWrite2, translateItems } from "../../../coins2";
const confidenceThreshold: number = 0.3;

export async function getTokenAndRedirectData(
Expand Down Expand Up @@ -74,6 +74,7 @@ export function addToDBWritesList(
: {}),
adapter,
confidence: Number(confidence),
timestamp,
},
],
);
Expand Down Expand Up @@ -325,6 +326,17 @@ export async function batchWriteWithAlerts(
);
await batchWrite(filteredItems, failOnError);
}
// export async function batchWrite2WithAlerts(
// items: AWS.DynamoDB.DocumentClient.PutItemInputAttributeMap[],
// ) {
// const previousItems: DbEntry[] = await readPreviousValues(items);
// const filteredItems: AWS.DynamoDB.DocumentClient.PutItemInputAttributeMap[] = await checkMovement(
// items,
// previousItems,
// );

// await batchWrite2(await translateItems(filteredItems));
// }
async function readPreviousValues(
items: AWS.DynamoDB.DocumentClient.PutItemInputAttributeMap[],
): Promise<DbEntry[]> {
Expand Down

0 comments on commit 7c3bc74

Please sign in to comment.