Refresh articles
- every 30 minutes - after completion of onboarding
This commit is contained in:
parent
be851be039
commit
da4fb6ac72
2 changed files with 9 additions and 4 deletions
|
|
@ -7,6 +7,7 @@
|
||||||
use App\Http\Resources\PlatformAccountResource;
|
use App\Http\Resources\PlatformAccountResource;
|
||||||
use App\Http\Resources\PlatformChannelResource;
|
use App\Http\Resources\PlatformChannelResource;
|
||||||
use App\Http\Resources\RouteResource;
|
use App\Http\Resources\RouteResource;
|
||||||
|
use App\Jobs\ArticleDiscoveryJob;
|
||||||
use App\Models\Feed;
|
use App\Models\Feed;
|
||||||
use App\Models\Language;
|
use App\Models\Language;
|
||||||
use App\Models\PlatformAccount;
|
use App\Models\PlatformAccount;
|
||||||
|
|
@ -332,10 +333,7 @@ public function createRoute(Request $request): JsonResponse
|
||||||
*/
|
*/
|
||||||
public function complete(): JsonResponse
|
public function complete(): JsonResponse
|
||||||
{
|
{
|
||||||
// In a real implementation, we might want to update a user preference
|
ArticleDiscoveryJob::dispatch();
|
||||||
// or create a setting that tracks onboarding completion
|
|
||||||
// For now, we'll just return success since the onboarding status
|
|
||||||
// is determined by the existence of platform accounts, feeds, and channels
|
|
||||||
|
|
||||||
return $this->sendResponse(
|
return $this->sendResponse(
|
||||||
['completed' => true],
|
['completed' => true],
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
use App\Jobs\ArticleDiscoveryJob;
|
||||||
use App\Jobs\PublishNextArticleJob;
|
use App\Jobs\PublishNextArticleJob;
|
||||||
use App\Jobs\SyncChannelPostsJob;
|
use App\Jobs\SyncChannelPostsJob;
|
||||||
use Illuminate\Support\Facades\Schedule;
|
use Illuminate\Support\Facades\Schedule;
|
||||||
|
|
@ -13,3 +14,9 @@
|
||||||
->name('publish-next-article')
|
->name('publish-next-article')
|
||||||
->withoutOverlapping()
|
->withoutOverlapping()
|
||||||
->onOneServer();
|
->onOneServer();
|
||||||
|
|
||||||
|
Schedule::job(new ArticleDiscoveryJob)
|
||||||
|
->everyThirtyMinutes()
|
||||||
|
->name('refresh-articles')
|
||||||
|
->withoutOverlapping()
|
||||||
|
->onOneServer();
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue