mirror of
https://github.com/friendica/friendica
synced 2025-05-04 07:44:10 +02:00
Configuration is now stored in the "channel" section
This commit is contained in:
parent
5c166be3fc
commit
59a822ee87
3 changed files with 5 additions and 5 deletions
|
@ -781,7 +781,7 @@ class Relation
|
|||
*/
|
||||
public static function calculateInteractionScore(int $uid)
|
||||
{
|
||||
$days = DI::config()->get('system', 'interaction_score_days');
|
||||
$days = DI::config()->get('channel', 'interaction_score_days');
|
||||
$contact_id = Contact::getPublicIdByUserId($uid);
|
||||
|
||||
Logger::debug('Calculation - start', ['uid' => $uid, 'cid' => $contact_id, 'days' => $days]);
|
||||
|
|
|
@ -25,6 +25,7 @@ use Friendica\Core\Logger;
|
|||
use Friendica\Core\Protocol;
|
||||
use Friendica\Database\Database;
|
||||
use Friendica\Database\DBA;
|
||||
use Friendica\DI;
|
||||
use Friendica\Model\Contact;
|
||||
use Friendica\Model\Item;
|
||||
use Friendica\Model\Post;
|
||||
|
@ -69,7 +70,7 @@ class Engagement
|
|||
return;
|
||||
}
|
||||
|
||||
if ($parent['created'] < DateTimeFormat::utc('now - 1 day')) {
|
||||
if ($parent['created'] < DateTimeFormat::utc('now - ' . DI::config()->get('channel', 'engagement_hours') . ' 24 hour')) {
|
||||
Logger::debug('Post is too old', ['uri-id' => $item['uri-id'], 'parent-uri-id' => $item['parent-uri-id'], 'created' => $parent['created']]);
|
||||
return;
|
||||
}
|
||||
|
@ -92,7 +93,7 @@ class Engagement
|
|||
|
||||
public static function expire()
|
||||
{
|
||||
DBA::delete('post-engagement', ["`created` < ?", DateTimeFormat::utc('now - 1 day')]);
|
||||
DBA::delete('post-engagement', ["`created` < ?", DateTimeFormat::utc('now - ' . DI::config()->get('channel', 'engagement_hours') . ' 24 hour')]);
|
||||
Logger::notice('Cleared expired engagements', ['rows' => DBA::affectedRows()]);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue