gpt4 book ai didi

ruby - 来自 Resque Standalone 的远程 Redis 服务器

转载 作者:可可西里 更新时间:2023-11-01 11:21:30 24 4
gpt4 key购买 nike

我想在不同的服务器上运行 Resque worker,从一台 Redis 服务器获取作业。我知道如何在 Rails 应用程序中配置它,但问题是我在每个服务器上都使用独立的 Resque ( https://github.com/dcestari/resque-standalone-sample )。

所以我的问题是,如何在不安装 Rails 应用程序的情况下执行此操作,这可能吗?

谢谢!

最佳答案

你需要告诉 Resque Redis 在哪里:

Resque.configure do |config|

# Set the redis connection. Takes any of:
# String - a redis url string (e.g., 'redis://host:port')
# String - 'hostname:port[:db][/namespace]'
# Redis - a redis connection that will be namespaced :resque
# Redis::Namespace - a namespaced redis connection that will be used as-is
# Redis::Distributed - a distributed redis connection that will be used as-is
# Hash - a redis connection hash (e.g. {:host => 'localhost', :port => 6379, :db => 0})
config.redis = 'redis://someserverip:port:db/namespace'

end

关于ruby - 来自 Resque Standalone 的远程 Redis 服务器,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28720164/

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