#viky_code

1 messages ¡ Page 1 of 1 (latest)

sick garnetBOT
#

👋 Welcome to your new thread!

⏲️ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.

⏱️ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.

🔗 This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1285875610651988038

📝 Have more to share? Add more details, code, screenshots, videos, etc. below.

Below are links to other discussions we've had with you in the past week in case you want to review that information. If your question is related to one of these previous discussions, please provide a comprehensive summary of the current state and what you need help with now. We help many users simultaneously, so a summary allows us to resolve your issue as soon as possible.

worthy kettle
long vessel
#

No that will not work for me

worthy kettle
#

ok. Well then listing charges works yes! if you have a lot of them it and you don't filter it in any way(like adding created as a filter on charges.list() then it will take a while to list them all, that's normal and you'd need a long-running backend process

long vessel
#

dont understood
can you give me an example

worthy kettle
#

an example of what?

long vessel
#

The things you said

worthy kettle
#

you need to be more specific about what part you are struggling with.

long vessel
#

let count = 0

const succeededCharges = await stripe.charges.list(
{
limit: 100,
},

).autoPagingEach(function (item) {
    count++
    console.log(item.status, "item")

})

This thing is taking 30 seconds

#

how can the api survive 30 seconds

#

and giving me count of 853

#

what if transactions are more than it

#

it will take more time

worthy kettle
#

that's all normal yes, making the API requests takes time

long vessel
#

No any way to optmize

#

Our users will not wait on page for 30-40 seconds

worthy kettle
#

I'd recommend not passing limit:100, so that instead it is more, but faster because they're smaller, API calls

long vessel
#

This will degade the quality of our platform

worthy kettle
#

your customer facing page should be reading from e.g. your database that you periodically update with backend syncs with Stripe.