--MON--
--MON--
DTDrizzle Team
Created by --MON-- on 9/12/2023 in #help
onDuplicateKeyUpdate
also when i used this with i think planetscale the concern why i was doing it was useless i wanted to do the batched tx so it would only be using a single tx which in the per tx model would be cheap but planetscale uses per write model so it was useless and had to go back to that async for loop method
72 replies
DTDrizzle Team
Created by --MON-- on 9/12/2023 in #help
onDuplicateKeyUpdate
then for looped those inserts
72 replies
DTDrizzle Team
Created by --MON-- on 9/12/2023 in #help
onDuplicateKeyUpdate
yeah that's how i did it too, i moved it out of the db.transaction and used async
72 replies
DTDrizzle Team
Created by --MON-- on 9/12/2023 in #help
onDuplicateKeyUpdate
cause this one i think will cause that tx pool connection limit error since this is generating several actions in a single transaction batch which only allows for a limited amount of actions
72 replies
DTDrizzle Team
Created by --MON-- on 9/12/2023 in #help
onDuplicateKeyUpdate
which code are we talking about?
72 replies
DTDrizzle Team
Created by --MON-- on 9/12/2023 in #help
onDuplicateKeyUpdate
well there are still pros and cons hahaha
72 replies
DTDrizzle Team
Created by --MON-- on 9/12/2023 in #help
onDuplicateKeyUpdate
yeah about 2.8 hrs 🤣
72 replies
DTDrizzle Team
Created by --MON-- on 9/12/2023 in #help
onDuplicateKeyUpdate
600+ loops
72 replies
DTDrizzle Team
Created by --MON-- on 9/12/2023 in #help
onDuplicateKeyUpdate
100 items 1 request 100 database entries per 15 sec
72 replies
DTDrizzle Team
Created by --MON-- on 9/12/2023 in #help
onDuplicateKeyUpdate
it's a community api for another project which i am using to fetch game data and use that data for the app i am building
72 replies
DTDrizzle Team
Created by --MON-- on 9/12/2023 in #help
onDuplicateKeyUpdate
i actually did an incremental timeout, so starting with 1 ms then +15000 each loop 🤣
72 replies
DTDrizzle Team
Created by --MON-- on 9/12/2023 in #help
onDuplicateKeyUpdate
so to prevent 429 error i used setTimeout in 15 sec interval
72 replies
DTDrizzle Team
Created by --MON-- on 9/12/2023 in #help
onDuplicateKeyUpdate
i'm trying to migrate it to setInterval now the reason is the REST endpoint has a 15 second per request rate limit
72 replies
DTDrizzle Team
Created by --MON-- on 9/12/2023 in #help
onDuplicateKeyUpdate
hahaha the previous method worked but the onDuplicateKey is a problem now onDuplicateKey is working using transactions but i'm getting connection limit exceeded 🤣
72 replies
DTDrizzle Team
Created by --MON-- on 9/12/2023 in #help
onDuplicateKeyUpdate
so i'm basically creating 600+ set timeouts
72 replies
DTDrizzle Team
Created by --MON-- on 9/12/2023 in #help
onDuplicateKeyUpdate
basically for loop setTimeout 15 sec fetch transaction
72 replies
DTDrizzle Team
Created by --MON-- on 9/12/2023 in #help
onDuplicateKeyUpdate
cause i'm logging the data from a Rest Api with a 15 second per request
72 replies
DTDrizzle Team
Created by --MON-- on 9/12/2023 in #help
onDuplicateKeyUpdate
ohh yeah i forgot 🤣 i set it in a setTimeout inside a loop
72 replies
DTDrizzle Team
Created by --MON-- on 9/12/2023 in #help
onDuplicateKeyUpdate
when i use for loop
DatabaseError: 'target: mydb.-.primary: vttablet: rpc error: code = ResourceExhausted
desc = transaction pool connection limit exceeded (CallerID: ...)'
DatabaseError: 'target: mydb.-.primary: vttablet: rpc error: code = ResourceExhausted
desc = transaction pool connection limit exceeded (CallerID: ...)'
when using .map
DatabaseError: 'target: mydb.-.primary: vttablet: rpc error: code = ResourceExhausted
desc = transaction pool connection limit exceeded (CallerID: ...)'
DatabaseError: 'target: mydb.-.primary: vttablet: rpc error: code = ResourceExhausted
desc = transaction pool connection limit exceeded (CallerID: ...)'
72 replies
DTDrizzle Team
Created by --MON-- on 9/12/2023 in #help
onDuplicateKeyUpdate
@angelelz i was inserting 100 items and just hit the connection limit... any way to solve this one?
72 replies