开发者

Rebilling Customers using Cron?

开发者 https://www.devze.com 2023-04-10 17:24 出处:网络
We need to rebill x amount of customers on any given day. Currently, we run a cron every 5 mins to bill 20 people/send invoice etc

We need to rebill x amount of customers on any given day.

Currently, we run a cron every 5 mins to bill 20 people/send invoice etc

However, when the number of customers grows, extending to 100 people per 5 min may result in the cron overlapping and billing customers twice.

I have two thoughts:

Running the cron once, but making it sleep x amount after 20 billed/invoiced so that 开发者_StackOverflow中文版we dont spam the API.

Using a message queue where people are added to the queue and then "workers" process the queue. The problem is I have no experience in this, so not sure what is the best route to take.

Does anyone have any experience in this?

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号