I'm using CKEditor 5 in a Laravel project, getting it from a CDN, so initially I have not needed to run npm. But now I need an alignment plugin, so I used Laravel Mix to run npm install, and then copy the plugin to public folder. Like this:
mix.copyDirectory('node_modules/@ckeditor', 'public/@ckeditor');
Run Code Online (Sandbox Code Playgroud)
In my code, I tried to import it:
import Alignment from '/@ckeditor/ckeditor5-alignment/src/alignment.js';
Run Code Online (Sandbox Code Playgroud)
So it threw this error in console
Uncaught TypeError: Failed to resolve module specifier "@ckeditor/ckeditor5-core/src/plugin". Relative references must …
问题
我正在分派一个作业来执行一个需要准备好资源才能正确执行的操作,因此如果失败,则需要在一段时间后重试。但真正发生的情况是,如果失败,就不会再次执行。我正在使用 Supervisor 来管理队列和数据库驱动程序,并且我在默认的queue.php配置文件中没有进行任何更改。
使用 Laravel 5.8。
我尝试过的
我已经尝试过手动设置作业类中的尝试次数,例如
public $tries = 5;
Run Code Online (Sandbox Code Playgroud)
以及与重试延迟相同的事情
public $retryAfter = 60;
Run Code Online (Sandbox Code Playgroud)
我的代码
我基于使用 make:job 制作的默认作业模板来实现此作业,我的构造函数和处理方法如下所示:
public function __construct($event, $data)
{
$this->event = $event;
$this->data = $data;
}
public function handle()
{
Log::info('Job started | ' . $this->event . ' | Attempt: ' . $this->attempts());
// Executes some logic and throws an Exception if it fails
Log::info('Job succeeded | ' . $this->event);
}
Run Code Online (Sandbox Code Playgroud)
最后,它不会到达“作业成功”日志,并且不会记录除 1 之外的任何其他尝试。
我是否缺少一些概念或者这段代码是否有问题?