gem 没有 sidekiq 值得推荐

gem recommendable without sidekiq

我是 Rails 的新手,目前我正在使用 gem recommendable .当我安装 sidekiq 时,是的,它工作正常。但是当我不启动sidekiq时,它总是给我空洞的建议。

我在自述文件中看到了描述

Bundling one of the queueing systems above is highly recommended to avoid having to manually refresh users' recommendations.

什么叫相互刷新用户的推荐?如果我不使用排队系统,我应该怎么做才能获得当前的推荐?

配置:

Recommendable.configure do |config|
  config.redis = RedisUsage.client

  config.redis_namespace = :recommendable

  config.auto_enqueue = true

  config.nearest_neighbors = nil

  config.furthest_neighbors = nil

  config.recommendations_to_store = 2

  config.orm = :active_record
 end

这可能是个愚蠢的问题?不过我找了很久

以下2行在Recommendable.enqueue()

中执行

Recommendable::Helpers::Calculations.update_similarities_for(user_id) Recommendable::Helpers::Calculations.update_recommendations_for(user_id)