#65 Turn on/off accesslog flushing

closed-accepted
Rob Malda
5
2001-12-03
2001-11-07
shane
No

This creates a constant var to turn on/off the sub
DeleteDaily's accesslog trimming.

I needed the functionality for another site I'm doing.
Odds are others might want this feature because few of
us have slash sites as busy as slashdot.

Two patches below, both made with:

diff -c Slash/DB/Static/MySQL/MySQL.bak.pm
Slash/DB/Static/MySQL/MySQL.pm
diff -c sql/mysql/defaults.bak.sql
sql/mysql/defaults.sql

BEGIN PATCH OF Slash/DB/Static/MySQL/MySQL.pm

*** Slash/DB/Static/MySQL/MySQL.bak.pm Wed Nov 7
16:51:41 2001
--- Slash/DB/Static/MySQL/MySQL.pm Wed Nov 7
16:52:31 2001
***************
*** 312,318 ****

# Note, on Slashdot, the next line locks the
accesslog for several
# minutes, up to 10 minutes if traffic has
been heavy.
! $self->sqlDo("DELETE FROM accesslog WHERE
date_add(ts,interval 48 hour) < now()");
}

#######################################################
#
--- 312,320 ----

# Note, on Slashdot, the next line locks the
accesslog for several
# minutes, up to 10 minutes if traffic has
been heavy.
! if ($constants->{flushaccesslog}) {
! $self->sqlDo("DELETE FROM accesslog WHERE
date_add(ts,interval 48 hour) < now()");
! }
}

#######################################################
#

END PATCH

BEGIN PATCH OF sql/mysql/defaults.sql

*** sql/mysql/defaults.bak.sql Wed Nov 7 17:00:52
2001
--- sql/mysql/defaults.sql Wed Nov 7 17:01:07
2001
***************
*** 505,507 ****
--- 505,508 ----
INSERT INTO vars (name, value, description) VALUES
('writestatus','ok','Simple Boolean to determine if
homepage needs rewriting');
INSERT INTO vars (name, value, description) VALUES
('max_submission_size','32000','max size of submission
before warning message is displayed');
INSERT INTO vars (name, value, description) VALUES
('lenient_formkeys','0','0 - only ipid, 1 - ipid OR
subnetid, in formkey validation check');
+ INSERT INTO vars (name, value, description) VALUES
('flushaccesslog','1','Flush the accesslog table,
1=Yes, 0=No');

END PATCH

Discussion

  • shane
    shane
    2001-11-07

    Logged In: YES
    user_id=52587

    Ok, my mistake. I'll upload the files. Viewing them on SF
    centered in html is just plain useless.

     
  • shane
    shane
    2001-11-07

    Slash/DB/Static/MySQL/MySQL.pm logflush patch

     
  • shane
    shane
    2001-11-07

    defaults.sql logflush patch

     
  • Chris Nandor
    Chris Nandor
    2001-12-03

    • assigned_to: nobody --> cmdrtaco
    • status: open --> open-accepted
     
  • Chris Nandor
    Chris Nandor
    2001-12-03

    Logged In: YES
    user_id=3660

    Thanks, accepted (except that I changed the logic, from
    flushaccesslog to noflush_accesslog, so the default, the
    current behavior, will be false, so those who upgrade and
    don't add in the new variable won't get changed behavior).

     
  • Rob Malda
    Rob Malda
    2001-12-03

    • status: open-accepted --> closed-accepted