Fix automatic article discovery
This commit is contained in:
parent
2a68895ba9
commit
696e2b5235
4 changed files with 32 additions and 3 deletions
|
|
@ -2,6 +2,7 @@
|
|||
|
||||
namespace App\Jobs;
|
||||
|
||||
use App\Models\Feed;
|
||||
use App\Models\Setting;
|
||||
use App\Services\Log\LogSaver;
|
||||
use Illuminate\Contracts\Queue\ShouldQueue;
|
||||
|
|
@ -20,14 +21,16 @@ public function handle(): void
|
|||
{
|
||||
if (!Setting::isArticleProcessingEnabled()) {
|
||||
LogSaver::info('Article processing is disabled. Article discovery skipped.');
|
||||
return;
|
||||
}
|
||||
|
||||
if (!Feed::where('is_active', true)->exists()) {
|
||||
LogSaver::info('No active feeds found. Article discovery skipped.');
|
||||
return;
|
||||
}
|
||||
|
||||
LogSaver::info('Starting article discovery for all active feeds');
|
||||
|
||||
ArticleDiscoveryForFeedJob::dispatchForAllActiveFeeds();
|
||||
|
||||
LogSaver::info('Article discovery jobs dispatched for all active feeds');
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@
|
|||
|
||||
use App\Http\Middleware\HandleAppearance;
|
||||
use App\Http\Middleware\HandleInertiaRequests;
|
||||
use Illuminate\Console\Scheduling\Schedule;
|
||||
use Illuminate\Foundation\Application;
|
||||
use Illuminate\Foundation\Configuration\Exceptions;
|
||||
use Illuminate\Foundation\Configuration\Middleware;
|
||||
|
|
@ -23,6 +24,16 @@
|
|||
AddLinkHeadersForPreloadedAssets::class,
|
||||
]);
|
||||
})
|
||||
->withSchedule(function (Schedule $schedule) {
|
||||
$schedule->command('article:refresh')
|
||||
->everyFifteenMinutes()
|
||||
->when(function () {
|
||||
return \App\Models\Setting::isArticleProcessingEnabled()
|
||||
&& \App\Models\Feed::where('is_active', true)->exists();
|
||||
})
|
||||
->withoutOverlapping()
|
||||
->onOneServer();
|
||||
})
|
||||
->withExceptions(function (Exceptions $exceptions) {
|
||||
$exceptions->reportable(function (Throwable $e) {
|
||||
$level = match (true) {
|
||||
|
|
|
|||
|
|
@ -182,7 +182,7 @@
|
|||
'defaults' => [
|
||||
'supervisor-1' => [
|
||||
'connection' => 'redis',
|
||||
'queue' => ['default', 'lemmy-posts', 'lemmy-publish'],
|
||||
'queue' => ['default', 'lemmy-posts', 'lemmy-publish', 'feed-discovery'],
|
||||
'balance' => 'auto',
|
||||
'autoScalingStrategy' => 'time',
|
||||
'maxProcesses' => 1,
|
||||
|
|
|
|||
|
|
@ -53,6 +53,21 @@ else
|
|||
echo "⚠️ Vite dev server may not have started properly"
|
||||
fi
|
||||
|
||||
# Check Laravel Horizon status inside the app container
|
||||
echo "🔍 Checking Laravel Horizon in app container..."
|
||||
HSTATUS="$(podman exec ffr-dev-app bash -lc "cd /var/www/html/backend && php artisan horizon:status" 2>/dev/null || echo "Horizon status: unknown")"
|
||||
echo "$HSTATUS"
|
||||
if echo "$HSTATUS" | grep -qi 'inactive'; then
|
||||
echo "ℹ️ Horizon is inactive. Attempting to start..."
|
||||
podman exec -d ffr-dev-app bash -lc "cd /var/www/html/backend && php artisan horizon > /dev/null 2>&1 &" || true
|
||||
sleep 2
|
||||
podman exec ffr-dev-app bash -lc "cd /var/www/html/backend && php artisan horizon:status" || true
|
||||
else
|
||||
echo "✅ Horizon appears to be running."
|
||||
fi
|
||||
# Show supervisors summary (non-fatal if unavailable)
|
||||
podman exec ffr-dev-app bash -lc "cd /var/www/html/backend && php artisan horizon:supervisors | sed -n '1,80p'" || true
|
||||
|
||||
echo "✅ Development environment is ready!"
|
||||
echo "🌐 Application: http://localhost:8000"
|
||||
echo "🔥 Vite dev server: http://localhost:5173"
|
||||
|
|
|
|||
Loading…
Reference in a new issue