![](/img/trans.png)
[英]Jquery: code doesn't work when deployed on the server but runs fine in the browser console
[英]Meteor server .remove code doesn't work when deployed
我有一些代碼可以在不再需要在服務器上運行時清除循環中的元素:
setInterval(serverLoop, 1000);
function serverLoop() {
Fiber(function() {
Blocks.remove({type: "hit"});
Letters.remove({timeout: {$lte: 0}});
}).run();
}
該代碼在localhost:3000上有效,但是當我部署到meteor.com時,.remove不起作用。 我在這里想念什么嗎?
為什么不使用Meteor.setInterval
, http: Meteor.setInterval
呢?
Meteor.setInterval(serverLoop, 1000);
function serverLoop() {
Blocks.remove({type: "hit"});
Letters.remove({timeout: {$lte: 0}});
}
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.