Page 10 of 51 FirstFirst ... 8910111220 ... LastLast
Results 91 to 100 of 510
  1. #91
    Join Date
    Aug 2004
    Location
    Belfast, Northern Ireland
    Posts
    2,480
    Plugin Contributions
    14

    Default Re: Back In Stock Notifications

    Hi!

    How are you?

    Quote Originally Posted by brushwoodnursery View Post
    Just wondering if you had a chance to look at the throttling in phplist to try to adapt it to your mod?
    Unfortunately there's no throttling built into the module at present.

    It's would be a very handy feature I'd imagine, but unfortunately too much work to implement at this time.

    All the best...

    Conor
    Ceon

  2. #92
    Join Date
    Dec 2006
    Posts
    199
    Plugin Contributions
    0

    Default Re: Back In Stock Notifications

    Could there be a simple way to add
    PHP Code:
    sleep(10); 
    into the loop somewhere?
    I got that from the php manual.

  3. #93
    Join Date
    Aug 2004
    Location
    Belfast, Northern Ireland
    Posts
    2,480
    Plugin Contributions
    14

    Default Re: Back In Stock Notifications

    Hi,

    Quote Originally Posted by brushwoodnursery View Post
    Could there be a simple way to add
    PHP Code:
    sleep(10); 
    into the loop somewhere?
    I got that from the php manual.
    Certainly you can add that, but I don't know how much difference it will make. I'd imagine it'd probably be better than nothing but unfortunately I don't know enough about throttling to know if adding a 10 second delay would be enough to prevent servers blocking e-mails for breaching their limits for e-mails sent from a particular address. I'd have to research what these limits are and how any rules are applied in order to build an effective throttling mechanism into the software. Sadly, I just don't have the time to do that.

    Hopefully I will in the future as I think it would be useful to know and therefore useful to implement.

    As for the sleep() function. If you were to add it you'd have to add a counter into the sendBackInStockNotifications() function in

    admin\includes\functions\back_in_stock_notifications_functions.php

    and have it run the sleep command after a particular number of e-mails have been sent.

    All the best...

    Conor

  4. #94
    Join Date
    Dec 2006
    Posts
    199
    Plugin Contributions
    0

    Default Re: Back In Stock Notifications

    OK, just finished digging through the code in phplist and they do use sleep(x) as one of the throttling functions. They actually use three but this is described as the simplest way. The more complex ones are batch throttling (which would match what you mentioned about counting a batch then stopping) and domain throttling (which limits the number going to any one domain per period, an even more complex count).
    I'm just after a simple sleep(). If I have 1000 emails going out and I sleep(10) the loop, they would all still go out overnight easily. Can you tell me a good place to add that command? I don't think I need the counter, etc. A delay between each email sent would be fine with me.
    My only concern would be timeout.

  5. #95
    Join Date
    Aug 2004
    Location
    Belfast, Northern Ireland
    Posts
    2,480
    Plugin Contributions
    14

    Default Re: Back In Stock Notifications

    Hi,

    Just before line 154 of the admin/includes/functions/

    ($email_addresses_result->MoveNext();)

    You could add the following code:

    PHP Code:
    $num_emails_in_batch++

    if (
    $num_emails_in_batch 100) {
      
    $num_emails_in_batch 0;
      
      
    sleep(10);

    You should also add the following before the while loop on line 65:

    PHP Code:
    $num_emails_in_batch 0
    Just good coding practice! :)

    I might make this simple functionality an option in the next version with a configurable number of e-mails in a batch and sleep time.

    All the best...

    Conor
    Ceon

  6. #96
    Join Date
    Dec 2006
    Posts
    199
    Plugin Contributions
    0

    Default Re: Back In Stock Notifications

    Conor,
    You've been very patient with my persistent badgering about this little detail. Once again, thank you very much!

  7. #97
    Join Date
    Dec 2006
    Posts
    199
    Plugin Contributions
    0

    Default Re: Back In Stock Notifications

    Hmm...got trouble:
    Parse error: syntax error, unexpected T_IF in /home/xxxxxx/xxx/xxx/admin/includes/functions/back_in_stock_notifications_functions.php on line 158

    do i need the batch counter or can I just try the sleep?

  8. #98
    Join Date
    Dec 2006
    Posts
    199
    Plugin Contributions
    0

    Default Re: Back In Stock Notifications

    I commented out everything but the sleep(10);

    I have not entered inventory except a little testing bit. There would be 43 emails sent. At 10 seconds it stalls out and goes to a blank page. At 2 seconds, same thing. At 1 second, it takes just over 43 seconds (guesstimate) to return the successful results of a test mailing. In all 3 cases, the sample email was successfully sent out.

  9. #99
    Join Date
    Aug 2004
    Location
    Belfast, Northern Ireland
    Posts
    2,480
    Plugin Contributions
    14

    Default Re: Back In Stock Notifications

    Hi,

    Quote Originally Posted by brushwoodnursery View Post
    Hmm...got trouble:
    Parse error: syntax error, unexpected T_IF in /home/xxxxxx/xxx/xxx/admin/includes/functions/back_in_stock_notifications_functions.php on line 158

    do i need the batch counter or can I just try the sleep?
    Oops, there's a missing semicolon after

    PHP Code:
    $num_emails_in_batch++ 
    It should be:

    PHP Code:
    $num_emails_in_batch++; 
    Sorry! :)

    I have not entered inventory except a little testing bit. There would be 43 emails sent. At 10 seconds it stalls out and goes to a blank page. At 2 seconds, same thing. At 1 second, it takes just over 43 seconds (guesstimate) to return the successful results of a test mailing. In all 3 cases, the sample email was successfully sent out.
    Sounds like PHP is timing out.

    You must have safe mode on, otherwise the script would set the maximum execution time/timeout for PHP to 0 ("Don't time out").

    If you don't have access to your server to change the safe_mode setting or the max_execution setting then I'm afraid the sleep() command will be useless for you!

    All the best..

    Conor

  10. #100
    Join Date
    Dec 2006
    Posts
    199
    Plugin Contributions
    0

    Default Re: Back In Stock Notifications

    Safe Mode is Off.
    The notification panel pulls up just fine now.
    Test run works fine. There's no delay, though, since it's only 43 emails and they batch up as one.
    So, i ran the test with the batch size at 10 and the sleep at 20 seconds. Goes to blank page in just over 1 minute.
    maybe it's my database connection?
    I've decided to try to run it without the delay. I'll just do it after the phplist newsletter goes out and hope for the best. Looking through the list, most of the serious customers are waiting for multiple items. Also, not all of the items will be restocked at this time. It might be fine.

 

 
Page 10 of 51 FirstFirst ... 8910111220 ... LastLast

Similar Threads

  1. Ceon Back In Stock Notifications 3.0.0
    By conor in forum Addon Admin Tools
    Replies: 204
    Last Post: 8 Apr 2025, 05:19 PM
  2. Replies: 146
    Last Post: 13 Dec 2020, 09:52 AM
  3. Replies: 4
    Last Post: 14 Feb 2013, 09:33 PM
  4. v139h Back In Stock Notifications only notify customers ONE time?
    By SRQHoyas in forum General Questions
    Replies: 0
    Last Post: 9 Jun 2012, 01:58 PM
  5. Problems with Back In Stock Notifications addon
    By dhanesh in forum All Other Contributions/Addons
    Replies: 0
    Last Post: 21 Aug 2008, 02:26 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR