voroojax / waf-fle

Automatically exported from code.google.com/p/waf-fle
0 stars 0 forks source link

Put the LIMIT number as a var in config.php #31

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
* Describe feature request
To be able to choose ourself the LIMIT x when deleting records from the DB.
Now, it's hardcoded in functions.php in the deleteEventsByFilter & 
falsePositiveByFilter functions

* Witch benefit all users will get with this new feature?
When you have lots of records every day, the LIMIT 2000 is really not the best 
number.
And as I put a cron to delete every night all the record of today - 7, deleting 
200 000 records 2000 at a time is really bad for the server load.

To have the opportunity to chose ourself is an important I think.

And more, I can have a number in config.php used by waf-fle and I can put 
another number in my cron file.

In config.php, add:
<code>
// LIMIT number of deleted record for each pass
$LIMIT = 5000;
</code>

In functions.php:
<code>
function deleteEventsByFilter()
{
    ...
    global $LIMIT;
    ...
    $trailer =  ' AND events.preserve = 0 LIMIT '.$LIMIT.' ';

...

function falsePositiveByFilter()
{
    ...
    global $LIMIT;
    ...
    $trailer =  ' LIMIT '.$LIMIT.' ';
</code>

In cron/cron.php:
<code>
require_once("../functions.php");

// set LIMIT > than in config.php file for cron
$LIMIT = 15000;
</code>

Original issue reported on code.google.com by oxim...@gmail.com on 23 Jan 2014 at 5:23

GoogleCodeExporter commented 9 years ago
Is a good point, at this time waf-fle don't have his own schedulle job, but is 
on the way. 
However, this parameters will now available on devel tree 
(https://github.com/klaubert/waf-fle/tree/0.7.0-devel), and schedulled for 
release in few days.

Best regards, 

Klaubert

Original comment by klaub...@gmail.com on 29 Jan 2014 at 12:04