Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/redis/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何将ioredis连接到google云功能?_Redis_Google Cloud Platform_Google Cloud Firestore_Google Cloud Functions_Ioredis - Fatal编程技术网

如何将ioredis连接到google云功能?

如何将ioredis连接到google云功能?,redis,google-cloud-platform,google-cloud-firestore,google-cloud-functions,ioredis,Redis,Google Cloud Platform,Google Cloud Firestore,Google Cloud Functions,Ioredis,我目前正在运行一些Google Cloud函数(在typescript中),这些函数需要连接到Redis实例,以便LPUSH进入队列(在其他实例中,我使用Redis作为队列工作者)。 一切正常,除了我收到大量与ECONNECTRESET和econnectmeout相关的错误,尽管一切正常 下面的代码可以在cloud函数上成功执行,但我仍然看到与Redis连接相关的持续错误 我认为这与我如何导入我的client-ioredis有关。我有utils/index.ts,utils/redis.js,在

我目前正在运行一些Google Cloud函数(在typescript中),这些函数需要连接到Redis实例,以便
LPUSH
进入队列(在其他实例中,我使用Redis作为队列工作者)。
一切正常,除了我收到大量与
ECONNECTRESET
econnectmeout
相关的错误,尽管一切正常

下面的代码可以在cloud函数上成功执行,但我仍然看到与Redis连接相关的持续错误

我认为这与我如何导入我的
client-ioredis
有关。我有
utils/index.ts
utils/redis.js
,在
redis.js
中我有:

const Redis = require('ioredis'); 
module.exports = new Redis(6380, 'MYCACHE.redis.cache.windows.net', { tls: true, password: 'PASS' });
然后我在我的
utils/index.ts
中导入它,就像这样:代码丢失

导出一些aysnc函数,如:代码缺失

GCF
环境中执行时,我在
results.length
中获得了预期结果的#,我看到(通过内部监控Redis),该列表按预期推送到了队列中

然而,这些错误仍然不断出现

ioredis] Unhandled error event: Error: read ECONNRESET at _errnoException (util.js:1022:11) at TLSWrap.onread (net.js:628:25)

嗨,欢迎来到Stack Overflow!我改进了你问题的格式。我还注意到,您引用的是两段忘记添加的代码(我已将它们替换为缺少的代码)。您能否编辑您的问题并添加缺少的部分?似乎重复了以下内容: