gpt4 book ai didi

ruby-on-rails - 从命令行调试/执行 Discourse 插件

转载 作者:数据小太阳 更新时间:2023-10-29 08:42:40 24 4
gpt4 key购买 nike

我正在编写一个新的 discourse 插件,需要输出一些信息以了解我的方法是否正确。

有什么方法(用 rake 之类的)手动运行插件看看会发生什么?

Sidekiq 不显示任何输出...

谢谢!

编辑 1该插件强制某些用户观看类别...并且每 1 小时运行一次。我可以在 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!”一样运行您的代码!

关于ruby-on-rails - 从命令行调试/执行 Discourse 插件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53173668/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com