2020-08-16 08:39:04 +00:00
|
|
|
<?php
|
2024-08-24 15:27:00 +02:00
|
|
|
|
|
|
|
// Copyright (C) 2010-2024, the Friendica project
|
|
|
|
// SPDX-FileCopyrightText: 2010-2024 the Friendica project
|
|
|
|
//
|
|
|
|
// SPDX-License-Identifier: AGPL-3.0-or-later
|
2020-08-16 08:39:04 +00:00
|
|
|
|
|
|
|
namespace Friendica\Worker;
|
|
|
|
|
|
|
|
use Friendica\Database\DBA;
|
|
|
|
use Friendica\Model\Photo;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Update the cached values for the number of photo albums per user
|
|
|
|
*/
|
|
|
|
class UpdatePhotoAlbums
|
|
|
|
{
|
|
|
|
public static function execute()
|
|
|
|
{
|
2023-09-08 15:01:51 +00:00
|
|
|
$users = DBA::select('user', ['uid'], ['verified' => true, 'blocked' => false, 'account_removed' => false, 'account_expired' => false]);
|
2020-08-16 08:39:04 +00:00
|
|
|
while ($user = DBA::fetch($users)) {
|
|
|
|
Photo::clearAlbumCache($user['uid']);
|
|
|
|
}
|
|
|
|
DBA::close($users);
|
|
|
|
}
|
|
|
|
}
|