Make configurable to number of events stored in project activities

This commit is contained in:
Frederic Guillot 2017-10-19 10:50:36 -07:00
parent e7f795a63e
commit d3b8fbfa28
4 changed files with 12 additions and 8 deletions

View File

@ -20,13 +20,6 @@ class ProjectActivityModel extends Base
*/
const TABLE = 'project_activities';
/**
* Maximum number of events
*
* @var integer
*/
const MAX_EVENTS = 1000;
/**
* Add a new event for the project
*
@ -49,7 +42,7 @@ class ProjectActivityModel extends Base
'data' => json_encode($data),
);
$this->cleanup(self::MAX_EVENTS - 1);
$this->cleanup(PROJECT_ACTIVITIES_MAX_EVENTS - 1);
return $this->db->table(self::TABLE)->insert($values);
}

View File

@ -146,3 +146,5 @@ defined('HTTP_PROXY_PASSWORD') or define('HTTP_PROXY_PASSWORD', '');
defined('HTTP_VERIFY_SSL_CERTIFICATE') or define('HTTP_VERIFY_SSL_CERTIFICATE', true);
defined('TOTP_ISSUER') or define('TOTP_ISSUER', 'Kanboard');
defined('PROJECT_ACTIVITIES_MAX_EVENTS') or define('PROJECT_ACTIVITIES_MAX_EVENTS', 10000);

View File

@ -237,3 +237,6 @@ define('HTTP_VERIFY_SSL_CERTIFICATE', true);
// TOTP (2FA) issuer name
define('TOTP_ISSUER', 'Kanboard');
// Maximum number of events stored in the table "project_activities"
define('PROJECT_ACTIVITIES_MAX_EVENTS', 10000);

View File

@ -10,6 +10,9 @@ Enable/Disable debug mode
```php
define('DEBUG', true);
define('LOG_DRIVER', 'file'); // Other drivers are: syslog, stdout, stderr or file
// By default, the log file is in data/debug.log but you can change the path:
define('LOG_FILE', '/path/to/debug.log');
```
The log driver must be defined if you enable the debug mode.
@ -332,4 +335,7 @@ define('API_AUTHENTICATION_TOKEN', 'My unique API Token');
// TOTP (2FA) issuer name
define('TOTP_ISSUER', 'Kanboard');
// Maximum number of events stored in the table "project_activities"
define('PROJECT_ACTIVITIES_MAX_EVENTS', 10000);
```