forum.coppermine-gallery.net

No Support => Feature requests => Topic started by: wilk on July 23, 2015, 12:53:20 am

Title: [Done] Garbage collection log's retention
Post by: wilk on July 23, 2015, 12:53:20 am
It looks like this topic was raised in http://forum.coppermine-gallery.net/index.php?topic=67708.0 but no one made (or it was rejected) a feature request, so here it is.

FR: Option to specify precise duration for logs retention.

It might be a hidden (DB only) option.
Title: Re: Garbage collection log's retention
Post by: Αndré on July 23, 2015, 11:04:03 am
Unfortunately I cannot commit the hidden feature to our SVN repository currently, as SourceForge hasn't restored (http://sourceforge.net/blog/sourceforge-infrastructure-and-service-restoration-update-for-722/) the SVN service yet. As there's no ETA, here's at least the patch:
Code: [Select]
Index: cpg1.6.x/include/init.inc.php
===================================================================
--- cpg1.6.x/include/init.inc.php (revision 8796)
+++ cpg1.6.x/include/init.inc.php (working copy)
@@ -191,7 +191,7 @@
 }
 
 if ($CONFIG['log_mode']) {
-    spring_cleaning('logs', CPG_DAY * 2);
+    spring_cleaning('logs', ($CONFIG['log_retention'] > 0 ? $CONFIG['log_retention'] : CPG_DAY * 2));
 }
 
 // Record User's IP address
Index: cpg1.6.x/CHANGELOG.txt
===================================================================
--- cpg1.6.x/CHANGELOG.txt (revision 8797)
+++ cpg1.6.x/CHANGELOG.txt (working copy)
@@ -23,6 +23,7 @@
 [S] = Security fix (issues that are related to security)
 *********************************************
 
+2015-07-23 [A] Added hidden feature to adjust log file retention (thread ID 78309) {eenemeenemuu}
 2015-07-07 [B] Fixed album sort order for "first level" albums (thread ID 77314) {eenemeenemuu}
 2015-07-06 [B] Fixed GIF support check when resizing images (thread ID 78279) {eenemeenemuu}
 2015-06-10 [B] Fixed typo in user manager that created invalid user passwords (thread ID 76021) {eenemeenemuu}
Index: cpg1.5.x/include/init.inc.php
===================================================================
--- cpg1.5.x/include/init.inc.php (revision 8796)
+++ cpg1.5.x/include/init.inc.php (working copy)
@@ -191,7 +191,7 @@
 }
 
 if ($CONFIG['log_mode']) {
-    spring_cleaning('logs', CPG_DAY * 2, array('log_header.inc.php'));
+    spring_cleaning('logs', ($CONFIG['log_retention'] > 0 ? $CONFIG['log_retention'] : CPG_DAY * 2), array('log_header.inc.php'));
 }
 
 // Record User's IP address
Index: cpg1.5.x/CHANGELOG.txt
===================================================================
--- cpg1.5.x/CHANGELOG.txt (revision 8797)
+++ cpg1.5.x/CHANGELOG.txt (working copy)
@@ -23,6 +23,7 @@
 [S] = Security fix (issues that are related to security)
 *********************************************
 
+2015-07-23 [A] Added hidden feature to adjust log file retention (thread ID 78309) {eenemeenemuu}
 2015-07-07 [B] Fixed album sort order for "first level" albums (thread ID 77314) {eenemeenemuu}
 2015-07-06 [B] Fixed GIF support check when resizing images (thread ID 78279) {eenemeenemuu}
 2015-07-03 [M] Counted version count up in SVN repository from cpg1.5.36 to cpg1.5.37 {eenemeenemuu}
Title: Re: Garbage collection log's retention
Post by: wilk on July 26, 2015, 12:58:33 am
Thank you, applied and running. :) Had this hardcoded.

Maybe move to other solutions. SF has a bad rep lately...
Title: Re: Garbage collection log's retention
Post by: Phill Luckhurst on July 26, 2015, 07:57:43 pm
We have discussed alternatives for future development but moving had proven to very difficult.
Title: Re: Garbage collection log's retention
Post by: Αndré on July 27, 2015, 02:51:04 pm
Committed in SVN revision 8798.