Skip to content

Commit

Permalink
Skip deletion and smaller chunks
Browse files Browse the repository at this point in the history
  • Loading branch information
skakac committed Oct 25, 2024
1 parent 0d1c586 commit df777da
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/jobs/sync.job.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,10 @@ async function handle() {
(token) => `${token.address}:${token.chainId}`
)

const deleteTokens = currentTokens.filter((token) => {
return !newMints.includes(`${token.address}:${token.chainId}`)
})
const deleteTokens = [];
// currentTokens.filter((token) => {
// return !newMints.includes(`${token.address}:${token.chainId}`)
// })

const updateTokens = currentTokens.filter((token) => {
return newMints.includes(`${token.address}:${token.chainId}`)
Expand Down Expand Up @@ -93,7 +94,7 @@ async function handle() {
// }


const insertTokensBatches = _.chunk(insertTokens, 4000);
const insertTokensBatches = _.chunk(insertTokens, 2000);
for (const insertTokensBatch of insertTokensBatches) {
session = await mongoose.connection.startSession()
try {
Expand Down Expand Up @@ -131,7 +132,7 @@ async function handle() {
}
}

const updateTokensBatches = _.chunk(updateTokens, 4000);
const updateTokensBatches = _.chunk(updateTokens, 1000);
for (const updateTokensBatch of updateTokensBatches) {
session = await mongoose.connection.startSession()
try {
Expand Down

0 comments on commit df777da

Please sign in to comment.