Closed AdolphYu closed 12 months ago
Sorry, I don't quite get the question, what do you mean?
How to use scheduling in modules? For example: $schedule->command('emails:send Taylor --force')->daily();
public function boot()
{
$this->app->booted(function () {
$schedule = $this->app->make(Schedule::class);
$schedule->command('aaa:aaa')->everyTenMinutes()->withoutOverlapping();;
});
}
I checked it with our team, they usually make it like this:
public function boot()
{
$this->callAfterResolving(Schedule::class, function (Schedule $schedule) {
$schedule->command(ImportCountries::class)->dailyAt('05:45');
$schedule->command(ImportDesigners::class)->dailyAt('05:46');
$schedule->job(new GoogleMerchantCenterFeedJob())->dailyAt('07:00');
$schedule->call(function (ProductSalesRankService $productSalesRankService) {
$productSalesRankService->upgradeProducts(now()->subMonths(6));
})->cron('30 6 * * SUN');
});
}
In this regard, Concord modules are just regular Laravel Service Providers
I checked it with our team, they usually make it like this:
public function boot() { $this->callAfterResolving(Schedule::class, function (Schedule $schedule) { $schedule->command(ImportCountries::class)->dailyAt('05:45'); $schedule->command(ImportDesigners::class)->dailyAt('05:46'); $schedule->job(new GoogleMerchantCenterFeedJob())->dailyAt('07:00'); $schedule->call(function (ProductSalesRankService $productSalesRankService) { $productSalesRankService->upgradeProducts(now()->subMonths(6)); })->cron('30 6 * * SUN'); }); }
In this regard, Concord modules are just regular Laravel Service Providers
Thanks!
Sorry, I don't quite get the question, what do you mean?