0

我最初安排了几个作业来运行,但随后将它们从内核中删除。然而,它们仍在运行,并且没有出现在计划作业列表中!我知道它们正在运行,因为它们失败了,我在日志中记录了作业的名称,然后它作为 Log::info 运行。这让我发疯了。我正在使用 Laravel Vapor。我错过了什么?

正在运行的作业称为 AutoSendFaxWithEncounter 和 AutoSendFaxWithReferral 正在运行的作业,但不在调度程序中

内核.php


namespace App\Console;

use Illuminate\Console\Scheduling\Schedule;
use Illuminate\Support\Facades\Artisan;
use Illuminate\Foundation\Console\Kernel as ConsoleKernel;
use DB;
class Kernel extends ConsoleKernel
{
    /**
     * The Artisan commands provided by your application.
     *
     * @var array
     */
    protected $commands = [
       Commands\ProcessFiles::class, 
       Commands\ImportCustomerFills::class, 
       Commands\ImportCustomerEncounters::class, 
       Commands\ImportCustomerReferrals::class, 
       Commands\IndexFills::class, 
       Commands\IndexEncounters::class,
       Commands\IndexReferrals::class,  
       Commands\CreateS3Directories::class,
       Commands\FilterFills::class, 
       Commands\InsertPatients::class, 
       Commands\InsertPharmacies::class, 
       Commands\InsertProviders::class, 
       Commands\InsertProducts::class, 
      
  
    ];

    /**
     * Define the application's command schedule.
     *
     * @param  \Illuminate\Console\Scheduling\Schedule  $schedule
     * @return void
     */
    protected function schedule(Schedule $schedule)
    {
        
        $schedule->job(new \App\Jobs\IncomingFaxage(3))
            ->everyFiveMinutes()->environments(['production','local','staging']);
        
            $schedule->job(new \App\Jobs\UpdateFaxageStatus(3))
            ->everyFiveMinutes()->environments(['production','local','staging']);
        
            $schedule->job(new \App\Jobs\StoreInboundS3())
            ->everyFiveMinutes()->environments(['production','local','staging']);
        
            $schedule->job(new \App\Jobs\StoreOutboundS3())
            ->everyFiveMinutes()->environments(['production','local','staging']);
        
            $schedule->job(new \App\Jobs\InsertProducts())
            ->everyFiveMinutes()->environments(['production','local','staging']);
        
            $schedule->job(new \App\Jobs\InsertPatients())
            ->everyFiveMinutes()->environments(['production','local','staging']);
        
            $schedule->job(new \App\Jobs\InsertProviders())
            ->everyFiveMinutes()->environments(['production','local','staging']);
            
            $schedule->job(new \App\Jobs\InsertPharmacies())
            ->everyFiveMinutes()->environments(['production','local','staging']);

            /*
            $schedule->job(new \App\Jobs\InsertClaims())
            ->everyFiveMinutes()->environments(['production','local','staging']);
            */
            
            $schedule->job(new \App\Jobs\InsertEncounterLocations())
            ->everyFiveMinutes()->environments(['production','local','staging']);

            $schedule->job(new \App\Jobs\IndexFills())
            ->everyFiveMinutes()->environments(['production','local','staging']);
            
            $schedule->job(new \App\Jobs\IndexEncounters())
            ->everyFiveMinutes()->environments(['production','local','staging']);

            $schedule->job(new \App\Jobs\IndexReferrals())
            ->everyFiveMinutes()->environments(['production','local','staging']);

            $schedule->job(new \App\Jobs\IndexEncounterLocations())
            ->everyFiveMinutes()->environments(['production','local','staging']);
            
            $schedule->job(new \App\Jobs\FilterFills())
            ->everyFiveMinutes()->environments(['production','local','staging']);

            $schedule->job(new \App\Jobs\NpiRegistry())
            ->everyFiveMinutes()->environments(['production','local','staging']);

            $schedule->job(new \App\Jobs\RunImports())
            ->everyFiveMinutes()->environments(['production','local','staging']);
      
    }

    /**
     * Register the commands for the application.
     *
     * @return void
     */
    protected function commands()
    {
        $this->load(__DIR__.'/Commands');

        require base_path('routes/console.php');
    }
}
artisan schedule:list
+---------+-------------+-----------------------------------+----------------------------+
| Command | Interval    | Description                       | Next Due                   |
+---------+-------------+-----------------------------------+----------------------------+
|         | */5 * * * * | App\Jobs\IncomingFaxage           | 2021-07-28 15:35:00 +00:00 |
|         | */5 * * * * | App\Jobs\UpdateFaxageStatus       | 2021-07-28 15:35:00 +00:00 |
|         | */5 * * * * | App\Jobs\StoreInboundS3           | 2021-07-28 15:35:00 +00:00 |
|         | */5 * * * * | App\Jobs\StoreOutboundS3          | 2021-07-28 15:35:00 +00:00 |
|         | */5 * * * * | App\Jobs\InsertProducts           | 2021-07-28 15:35:00 +00:00 |
|         | */5 * * * * | App\Jobs\InsertPatients           | 2021-07-28 15:35:00 +00:00 |
|         | */5 * * * * | App\Jobs\InsertProviders          | 2021-07-28 15:35:00 +00:00 |
|         | */5 * * * * | App\Jobs\InsertPharmacies         | 2021-07-28 15:35:00 +00:00 |
|         | */5 * * * * | App\Jobs\InsertEncounterLocations | 2021-07-28 15:35:00 +00:00 |
|         | */5 * * * * | App\Jobs\IndexFills               | 2021-07-28 15:35:00 +00:00 |
|         | */5 * * * * | App\Jobs\IndexEncounters          | 2021-07-28 15:35:00 +00:00 |
|         | */5 * * * * | App\Jobs\IndexReferrals           | 2021-07-28 15:35:00 +00:00 |
|         | */5 * * * * | App\Jobs\IndexEncounterLocations  | 2021-07-28 15:35:00 +00:00 |
|         | */5 * * * * | App\Jobs\FilterFills              | 2021-07-28 15:35:00 +00:00 |
|         | */5 * * * * | App\Jobs\NpiRegistry              | 2021-07-28 15:35:00 +00:00 |
|         | */5 * * * * | App\Jobs\RunImports               | 2021-07-28 15:35:00 +00:00 |
+---------+-------------+-----------------------------------+----------------------------+
4

2 回答 2

0

我自己解决了这个问题。这是欺骗性的,并且在蒸汽文档中没有很好地记录。我的问题是我的部署 yaml 文件并在生产和暂存项目环境之间使用相同的自定义队列名称。我看到的是在另一个环境中运行但在同一个队列中的作业。

于 2022-01-06T20:50:44.100 回答
0

嘿,你需要检查一下 Vapor UI。

新的开源包:Vapor UI。简而言之,这个包在你的 Vapor 应用程序中提供了一个漂亮的仪表板,允许你监控应用程序的日志和失败的队列作业。

在这里,您可以检查与作业和调度相关的所有内容。

composer require laravel/vapor-ui


php artisan vapor-ui:install

欲了解更多信息,请查看以下网址。

https://docs.vapor.build/1.0/introduction.html#installing-the-vapor-ui-dashboard

于 2022-01-12T10:44:04.237 回答