mirror of
https://github.com/friendica/friendica
synced 2024-11-09 23:42:53 +00:00
Optimizing
This commit is contained in:
parent
72bc92db62
commit
55b6a89c7c
1 changed files with 8 additions and 0 deletions
|
@ -24,6 +24,7 @@ namespace Friendica\Protocol\ActivityPub;
|
||||||
use Friendica\Core\Logger;
|
use Friendica\Core\Logger;
|
||||||
use Friendica\Database\Database;
|
use Friendica\Database\Database;
|
||||||
use Friendica\Database\DBA;
|
use Friendica\Database\DBA;
|
||||||
|
use Friendica\DI;
|
||||||
use Friendica\Util\DateTimeFormat;
|
use Friendica\Util\DateTimeFormat;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -224,6 +225,13 @@ class Queue
|
||||||
// We delete all entries that aren't associated with a worker entry after seven days.
|
// We delete all entries that aren't associated with a worker entry after seven days.
|
||||||
// The other entries are deleted when the worker deferred for too long.
|
// The other entries are deleted when the worker deferred for too long.
|
||||||
DBA::delete('inbox-entry', ["`wid` IS NULL AND `received` < ?", DateTimeFormat::utc('now - 7 days')]);
|
DBA::delete('inbox-entry', ["`wid` IS NULL AND `received` < ?", DateTimeFormat::utc('now - 7 days')]);
|
||||||
|
|
||||||
|
// Optimizing this table only last seconds
|
||||||
|
if (DI::config()->get('system', 'optimize_tables')) {
|
||||||
|
Logger::info('Optimize start');
|
||||||
|
DBA::e("OPTIMIZE TABLE `inbox-entry`");
|
||||||
|
Logger::info('Optimize end');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in a new issue