简体   繁体   English

RxJs Subject 不会在生产环境触发订阅,但可以用于开发和测试

[英]RxJs Subject not triggering subscription on production environment but works on development and test

Yesterday my team deployed our angular app to a production server after it has been deployed to test server.昨天,我的团队在部署到测试服务器后将我们的 angular 应用程序部署到了生产服务器。

The app works in development mode and test server, but on production server the subjects are not triggering their subscription.该应用程序在开发模式和测试服务器下工作,但在生产服务器上,主题不会触发他们的订阅。 The same build that was published to test was published on production, there are no file differences.发布到测试的同一个构建发布在生产中,没有文件差异。

Does RxJs request some system setup which I'm not aware of which can cause subjects not to work? RxJs 是否请求了一些我不知道的系统设置,这会导致主题不起作用? I have no idea how to debug this nor what the reason for it not working might be.我不知道如何调试它,也不知道它不起作用的原因是什么。

Services that subjects are on are singleton, I do unsubscribe in ngOnDestroy block, and it works on test, so I don't think it is an issue in code.主题所在的服务是单例的,我在 ngOnDestroy 块中取消订阅,并且它在测试中有效,所以我不认为这是代码中的问题。

Any help or tip in which direction I should go to discover why it doesn't work is appreciated.任何帮助或提示我应该去发现为什么它不起作用的方向表示赞赏。

Using angular 6.2.2.使用角度 6.2.2。

We have managed to solve it a while back but I haven't posted the answer.我们已经设法解决了一段时间,但我还没有发布答案。

The issue was with SQL server read and write nodes having a tiny delay, which meant that after we sent a write to the write node we would trigger a read as soon as we get response back, but the read node didn't have the date updated yet (delay was couple of ms) so we got the same data again, which made us think the subscription didn't fire since we could see the value change in database but not the delay.问题在于 SQL Server 读写节点有一个很小的延迟,这意味着在我们向写入节点发送写入后,我们会在收到响应后立即触发读取,但读取节点没有日期尚未更新(延迟是几毫秒)所以我们再次获得了相同的数据,这让我们认为订阅没有触发,因为我们可以看到数据库中的值变化但看不到延迟。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 javascript代码部分未在测试环境中执行,可在生产,开发中使用(Rails 3应用) - javascript code partially not executed in test environment, works in production, development (Rails 3 app) Angular 5 Rxjs Subject.subscribe()未在多个组件中触发 - Angular 5 Rxjs Subject.subscribe() not triggering in multiple components JavaScript在开发中发挥作用,而不在生产中发挥作用(Heroku) - JavaScript Works in Development, Not in Production (Heroku) 如何在 node.js 中添加生产、开发和测试环境 - How can I add production, development and test environment in node.js 如何有条件地使用开发或生产环境变量 - How to conditionally use a development or production environment variable 如何编辑开发和生产的环境变量? - How to edit environment variable for development and production? 在生产与开发环境中处理javascript聚合 - Handling javascript aggregation in production vs development environment 条件在本机生产中反应失败,但在开发中有效 - Condition fails in react native production, but works in development 地理位置开发工作不在生产中 - Geo-location works in development not in production 反应助手导入在生产中失败,但在开发中工作 - react helper import fails in production but works in development
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM