ruby-on-rails - Debug / Execute Discourse plugin from command line
问题描述
I'm programming a new plugin in discourse and need to output some information to know if I'm in the right way.
There is some way (With rake or something) to manually run the plugin and see what happen?
Sidekiq don't show any output...
Thanks!
Edit 1 The plugin force some users to watch categories... And run each 1 hour. I can see it in Sidekiq.
module ::WatchCategory
def self.watch_category!
//The logic, foreach, etc...
end
end
after_initialize do
module ::WatchCategory
class WatchCategoryJob < ::Jobs::Scheduled
every 1.hours
def execute(args)
WatchCategory.watch_category!
end
end
end
end
解决方案
我从未使用过 discourse,但它看起来像一个 rails 应用程序,因此您应该能够通过 rails c 启动 rails 控制台。然后您应该能够运行您的代码,例如“WatchCategory.watch_category!”
推荐阅读
- maven - 无法为 Intellij 中的 maven 项目执行目标 org.apache.maven.plugins:maven-surefire-plugin
- php - 如何使用 PHP 在浏览新选项卡中显示 pdf 而不是下载文件?
- django - 我有一个关于 django 模型的问题。我在 Visual Studio 代码中创建了一个 django 模型。当我输入 charfield 时,它建议我下面的代码
- python - 使用字符串和 int 对列表进行排序。仅排序 int Python
- python - 如何在 Python 中对以下代码进行矢量化而不加入两个数据帧
- python-3.x - jinja2 使用双引号
- python - 如何在 opencv 4.4.0 版上正确使用 cv2.findContours()?
- javascript - 单个头文件中当前页面的活动导航菜单突出显示
- flutter - Flutter Apple 登录包未返回所需的凭据
- c - 在 C 中模糊图像:代码只有一半有效