[英]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.