Facebook  Twitter 

SMFHacks.com

+-

SMFHacks.com

+- User Information

Welcome, Guest.
Please login or register.
 
 
 
Forgot your password?

+- Forum Stats

Members
Total Members: 4257
Latest: Alex998.
New This Month: 1
New This Week: 0
New Today: 0
Stats
Total Posts: 43295
Total Topics: 7523
Most Online Today: 230
Most Online Ever: 2482
(April 09, 2011, 07:02:45 pm)
Users Online
Members: 0
Guests: 248
Total: 248

Author Topic: [Urgent] What happens to CheckGroupExpire if index.php gets hit hard per second  (Read 2889 times)

0 Members and 1 Guest are viewing this topic.

Offline shuban

  • Hero Member
  • *****
  • Posts: 665
    • View Profile
    • Biology Forums
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?


Offline SMFHacks

  • Administrator
  • Hero Member
  • *****
  • Posts: 16452
    • View Profile
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
Get your Forum Ranked! at https://www.forumrankings.net - find out how your forum compares with others!

Like What I do? Support me at https://www.patreon.com/vbgamer45/

Offline shuban

  • Hero Member
  • *****
  • Posts: 665
    • View Profile
    • Biology Forums
I created a cron instead. So you're telling me this is probably was the cause?

Offline SMFHacks

  • Administrator
  • Hero Member
  • *****
  • Posts: 16452
    • View Profile
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.
Get your Forum Ranked! at https://www.forumrankings.net - find out how your forum compares with others!

Like What I do? Support me at https://www.patreon.com/vbgamer45/

Offline shuban

  • Hero Member
  • *****
  • Posts: 665
    • View Profile
    • Biology Forums
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.

Thanks bro

 

Related Topics

  Subject / Started by Replies Last post
7 Replies
6622 Views
Last post December 31, 2006, 11:08:22 am
by brandy1j
1 Replies
5902 Views
Last post September 25, 2009, 07:34:04 am
by SMFHacks
[urgent] bug

Started by exit Bugs

3 Replies
6000 Views
Last post July 02, 2010, 01:45:35 pm
by exit
7 Replies
7297 Views
Last post March 29, 2012, 10:28:38 am
by SMFHacks
4 Replies
6244 Views
Last post July 28, 2016, 12:53:21 pm
by shuban

+- Recent Topics

Please Help! by SMFHacks
April 17, 2024, 08:04:55 am

Rate own images by fvlog19
April 11, 2024, 10:56:53 am

Tidy Child Boards on 2.1.4 by SMFHacks
April 04, 2024, 03:54:12 pm

Problems SMF 2.0.19 > 2.1.4 SMF Gallery Pro - Recents Images to overall header by Michel68
March 30, 2024, 12:41:08 pm

Can't DROP 'id_member'; check that column/key exists Datei: by SMFHacks
March 30, 2024, 11:58:20 am

No thumbnails on new uploads by Tonyvic
March 29, 2024, 06:26:18 am

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

Powered by EzPortal