我的应用程序中不断出现Redis :: Timeout错误(在UI和后台作业中).我正在为Redis使用AWS ElastiCache服务.
这就是我创建Redis连接的方式.在我的config/application.rb中,我有:
$redis = Redis.new(host: REDIS_HOST, port: REDIS_PORT, db: REDIS_DB)
Run Code Online (Sandbox Code Playgroud)
如何避免出现超时错误?我使用默认连接设置如下:
> $redis.client.options[:reconnect_attempts]
=> 1
> $redis.client.options[:timeout]
=> 5.0
> $redis.client.options[:tcp_keepalive]
=> 0
> $redis.client.options[:inherit_socket]
=> false
Run Code Online (Sandbox Code Playgroud) 我<Autocomplete>在Admin-on-rest 中使用组件。
<ReferenceInput label="Media" reference="Media" source="media_id" allowEmpty>
<AutocompleteInput source="name" />
</ReferenceInput>
Run Code Online (Sandbox Code Playgroud)
如果我在输入中输入一些东西,我的休息客户端会得到以下参数:
filter:{q: "1"}
Run Code Online (Sandbox Code Playgroud)
我想在名称上替换 q,与我的来源相同。我该怎么做?