Update (test): add indexing route
This commit is contained in:
@@ -19,16 +19,16 @@ protected function schedule(Schedule $schedule): void
|
|||||||
|
|
||||||
$launched_date = Carbon::parse(config('platform.global.launched_epoch'));
|
$launched_date = Carbon::parse(config('platform.global.launched_epoch'));
|
||||||
$days_since_launch = now()->diffInDays($launched_date) + 1;
|
$days_since_launch = now()->diffInDays($launched_date) + 1;
|
||||||
|
|
||||||
$posts_to_generate = get_exponential_posts_gen_by_day($days_since_launch);
|
$posts_to_generate = get_exponential_posts_gen_by_day($days_since_launch);
|
||||||
$mins_betwween_posts = floor((24 * 60) / $posts_to_generate);
|
$mins_between_posts = floor((24 * 60) / $posts_to_generate);
|
||||||
|
|
||||||
$schedule->call(function () {
|
$schedule->call(function () {
|
||||||
AISerpGenArticleJob::dispatch()->onQueue('default')->onConnection('default');
|
AISerpGenArticleJob::dispatch()->onQueue('default')->onConnection('default');
|
||||||
|
})->everyMinute()->when(function () use ($mins_between_posts, $launched_date) {
|
||||||
})->everyMinutes($mins_betwween_posts)->when(function () use ($mins_betwween_posts) {
|
$minutes_since_launch = now()->diffInMinutes($launched_date);
|
||||||
return now()->minute % $mins_betwween_posts === 0;
|
return $minutes_since_launch % $mins_between_posts === 0;
|
||||||
});
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -28,6 +28,11 @@
|
|||||||
|
|
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
Route::get('/now-minute', function (Request $request) {
|
||||||
|
dd(now()->minute);
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
Route::get('/indexing', [App\Http\Controllers\Tests\TestController::class, 'indexing']);
|
Route::get('/indexing', [App\Http\Controllers\Tests\TestController::class, 'indexing']);
|
||||||
|
|
||||||
Route::get('/serp-ai-gen', function (Request $request) {
|
Route::get('/serp-ai-gen', function (Request $request) {
|
||||||
|
|||||||
Reference in New Issue
Block a user