Ejegg has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/375032 )

Change subject: Thank you mailer: use process elapsed time to limit
......................................................................

Thank you mailer: use process elapsed time to limit

If the process start time is available, use that instead of the
time we get into the batch_process function to determine when to
stop.

Bug: T174690
Change-Id: Ib56b9e6e9cf5a1633d44bf744623b4faa532d292
---
M sites/all/modules/thank_you/thank_you.module
1 file changed, 7 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/wikimedia/fundraising/crm 
refs/changes/32/375032/1

diff --git a/sites/all/modules/thank_you/thank_you.module 
b/sites/all/modules/thank_you/thank_you.module
index 796cea9..3f5d2a7 100644
--- a/sites/all/modules/thank_you/thank_you.module
+++ b/sites/all/modules/thank_you/thank_you.module
@@ -698,8 +698,14 @@
 
 function thank_you_batch_process(){
        civicrm_initialize();
+       // If available, use the time the drush script started as the start time
+       // This way we're less likely to run past the start of the next run.
+       if ( isset( $_SERVER['REQUEST_TIME'] ) ) {
+               $startTime = $_SERVER['REQUEST_TIME'];
+       } else {
+               $startTime = time();
+       }
        // the following variables should be set in the module settings, not 
here
-       $startTime = time();
        $timeLimit = variable_get('thank_you_batch_time', 90); 
        $days = variable_get( 'thank_you_days', false );
        $batch = variable_get( 'thank_you_batch', false );

-- 
To view, visit https://gerrit.wikimedia.org/r/375032
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ib56b9e6e9cf5a1633d44bf744623b4faa532d292
Gerrit-PatchSet: 1
Gerrit-Project: wikimedia/fundraising/crm
Gerrit-Branch: master
Gerrit-Owner: Ejegg <ej...@ejegg.com>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to