Fix refresh job (#24)

This commit is contained in:
Daniel J. Summers 2024-06-12 07:49:56 -04:00
parent 0c87392910
commit c1901a68ec
2 changed files with 3 additions and 3 deletions

View File

@ -4,7 +4,7 @@ use BitBadger\PDODocument\{AutoId, Configuration};
use FeedReaderCentral\Data;
/** The current Feed Reader Central version */
const FRC_VERSION = '1.0.0-beta1';
const FRC_VERSION = '1.0.0-beta2';
/**
* Drop .0 or .0.0 from the end of the version to format it for display

View File

@ -34,7 +34,7 @@ function refresh_all(): void
{
try {
$users = [];
iterator_apply(Feed::retrieveAll()->items(), function (Feed $feed) use (&$users) {
foreach (Feed::retrieveAll()->items() as /** @var Feed $feed */ $feed) {
$result = Feed::refreshFeed($feed->id, $feed->url);
$userKey = "$feed->user_id";
if (!key_exists($userKey, $users)) $users[$userKey] = Find::byId(Table::USER, $feed->user_id, User::class);
@ -44,7 +44,7 @@ function refresh_all(): void
} else {
printfn('OK (%s) %s', $users[$userKey]->email, $feed->url);
}
});
}
printfn(PHP_EOL . 'All feeds refreshed');
} catch (DocumentException $ex) {
printfn("ERR $ex");