From c1901a68eccced1cbdc7da15b58f9953a12b9f20 Mon Sep 17 00:00:00 2001 From: "Daniel J. Summers" Date: Wed, 12 Jun 2024 07:49:56 -0400 Subject: [PATCH] Fix refresh job (#24) --- src/app-config.php | 2 +- src/util/refresh.php | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/app-config.php b/src/app-config.php index 775daf0..1debb8d 100644 --- a/src/app-config.php +++ b/src/app-config.php @@ -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 diff --git a/src/util/refresh.php b/src/util/refresh.php index 49b26ea..f7e933c 100644 --- a/src/util/refresh.php +++ b/src/util/refresh.php @@ -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");