|
Forum > Support
[Urgent] What happens to CheckGroupExpire if index.php gets hit hard per second
(1/1)
shuban:
In CheckGroupExpire, I have changed it in such a way so it charges members who are set to subscription via Stripe. Once it charges them, their time stamp in group_log time increases so they're not deleted from their membergroup.
However, I'm finding that sometimes the same member gets charged 4,5,6 times in one shot -- very bad! My question is, could index.php have something to do with it? Since the website it accessed many times per second, the function gets activated before it realizes that the time has been changed by updateSettings.
Is that a possiblity? And, if that's the case, could I start using cron jobs so that I activates the function precisely once every 30 minutes?
SMFHacks:
I wouldn't put in the index.php. I would put inside another script then call that script via a cron job. Maybe once a minute or so
shuban:
I created a cron instead. So you're telling me this is probably was the cause?
SMFHacks:
Yes could be a race condition if you have many people hit the same page at one time the code gets executed multiple times until the condition is no longer valid.
shuban:
--- Quote from: SMFHacks on August 23, 2017, 03:15:48 pm ---Yes could be a race condition if you have many people hit the same page at one time the code gets executed multiple times until the condition is no longer valid.
--- End quote ---
Thanks bro
Navigation
[0] Message Index |
No thumbnails on new uploads
by SMFHacks
March 27, 2024, 02:10:41 pm
|
Display the Contact Page for guests
by SMFHacks
March 27, 2024, 10:55:43 am
|
is it possible to add support for odysee.com
by fvlog19
March 21, 2024, 08:47:51 am
|
Request for admin notification
by davejo
March 10, 2024, 01:31:59 am
|
I need help with torrent upload
by Ineedsmfhelp
March 09, 2024, 10:01:13 pm
|
an idea for new mod (( content type with different display ))
by SMFHacks
February 27, 2024, 01:36:27 pm
|
[Mod] RSS Feed Poster
by SMFHacks
February 27, 2024, 11:57:18 am
|
find duplicate pictures
by fvlog19
February 14, 2024, 02:22:40 pm
|
Error uploading video.
by SMFHacks
February 08, 2024, 02:04:16 pm
|
Gallery icon as last added image
by fvlog19
February 01, 2024, 01:04:56 pm
|
|
|