Facebook  Twitter 

SMFHacks.com

+- +-

SMFHacks.com

+- User Information

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

+- Forum Stats

Members
Total Members: 12388
Latest: Rands
New This Month: 5
New This Week: 2
New Today: 0
Stats
Total Posts: 40308
Total Topics: 7099
Most Online Today: 42
Most Online Ever: 2482
(April 09, 2011, 07:02:45 pm)
Users Online
Members: 0
Guests: 21
Total: 21

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

0 Members and 1 Guest are viewing this topic.

Offline shuban

  • Hero Member
  • *****
  • Posts: 657
    • View Profile
    • Homework Clinic - Your Academic Lifeline
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: 15147
    • 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: 657
    • View Profile
    • Homework Clinic - Your Academic Lifeline
I created a cron instead. So you're telling me this is probably was the cause?

Offline SMFHacks

  • Administrator
  • Hero Member
  • *****
  • Posts: 15147
    • 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: 657
    • View Profile
    • Homework Clinic - Your Academic Lifeline
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
5662 Views
Last post December 31, 2006, 11:08:22 am
by brandy1j
1 Replies
3328 Views
Last post January 17, 2007, 12:35:17 am
by SBB
[urgent] bug

Started by exit Bugs

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

+- Recent Topics

Quality of images after import by SMFHacks
September 05, 2020, 10:21:44 am

How do I download gallery images? by CWVRV
August 30, 2020, 11:50:07 pm

Deleting Empty Galleries by SMFHacks
August 30, 2020, 11:43:32 am

PHP error by davejo
August 25, 2020, 07:35:13 am

Permissions to list ads and buy items by CWVRV
August 21, 2020, 05:19:45 pm

Doubt with download permissions. by Rock Lee
August 20, 2020, 08:23:24 pm

Attachment images Upsidedown or Sideways by SMFHacks
August 18, 2020, 05:41:07 pm

[Mod]Avatars Display Integration by Hatshepsut
August 17, 2020, 11:39:54 pm

Simple Portal Block - Classifieds by SMFHacks
August 16, 2020, 09:56:48 am

SMF Links by SMFHacks
August 16, 2020, 08:03:42 am

Powered by EzPortal