fix: switched sync integration to have redis lock

This commit is contained in:
=
2024-08-15 22:04:32 +05:30
parent 4feff5b4ca
commit 6cab7504fc
4 changed files with 176 additions and 114 deletions
+6
View File
@@ -1,2 +1,8 @@
export const getLastMidnightDateISO = (last = 1) =>
`${new Date(new Date().setDate(new Date().getDate() - last)).toISOString().slice(0, 10)}T00:00:00Z`;
export const getTimeDifferenceInSeconds = (lhsTimestamp: string, rhsTimestamp: string) => {
const lhs = new Date(lhsTimestamp);
const rhs = new Date(rhsTimestamp);
return Math.floor((Number(lhs) - Number(rhs)) / 1000);
};